Changeset eb4ad8d for lib


Ignore:
Timestamp:
2015-01-17T20:13:19Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e26aa72
Parents:
1065dd4 (diff), 664bac3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging random other fixes/cleanups.

Location:
lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lib/misc.c

    r1065dd4 reb4ad8d  
    780780        return NULL;
    781781}
     782
     783/* Takes a string, truncates it where it's safe, returns the new length */
     784int truncate_utf8( char *string, int maxlen )
     785{
     786        char *end;
     787        g_utf8_validate( (const gchar *) string, maxlen, (const gchar **) &end );
     788        *end = '\0';
     789        return end - string;
     790}
  • lib/misc.h

    r1065dd4 reb4ad8d  
    150150G_MODULE_EXPORT char **split_command_parts( char *command, int limit );
    151151G_MODULE_EXPORT char *get_rfc822_header( const char *text, const char *header, int len );
     152G_MODULE_EXPORT int truncate_utf8( char *string, int maxlen );
    152153
    153154#endif
  • lib/ns_parse.c

    r1065dd4 reb4ad8d  
    1919
    2020#ifndef lint
    21 static const char rcsid[] = "$Id: ns_parse.c,v 1.10 2009/01/23 19:59:16 each Exp $";
     21//static const char rcsid[] = "$Id: ns_parse.c,v 1.10 2009/01/23 19:59:16 each Exp $";
    2222#endif
    2323
  • lib/proxy.c

    r1065dd4 reb4ad8d  
    6666{
    6767        struct PHB *phb = data;
    68         unsigned int len;
     68        socklen_t len;
    6969        int error = ETIMEDOUT;
    7070        len = sizeof(error);
     
    8686                closesocket(source);
    8787                b_event_remove(phb->inpa);
     88                phb->inpa = 0;
    8889                if( phb->proxy_func )
    8990                        phb->proxy_func(phb->proxy_data, -1, B_EV_IO_READ);
     
    9798        sock_make_blocking(source);
    9899        b_event_remove(phb->inpa);
     100        phb->inpa = 0;
    99101        if( phb->proxy_func )
    100102                phb->proxy_func(phb->proxy_data, source, B_EV_IO_READ);
     
    174176/* Connecting to HTTP proxies */
    175177
    176 #define HTTP_GOODSTRING "HTTP/1.0 200 Connection established"
    177 #define HTTP_GOODSTRING2 "HTTP/1.1 200 Connection established"
     178#define HTTP_GOODSTRING "HTTP/1.0 200"
     179#define HTTP_GOODSTRING2 "HTTP/1.1 200"
    178180
    179181static gboolean http_canread(gpointer data, gint source, b_input_condition cond)
     
    214216        char cmd[384];
    215217        struct PHB *phb = data;
    216         unsigned int len;
     218        socklen_t len;
    217219        int error = ETIMEDOUT;
    218220        if (phb->inpa > 0)
     
    309311        struct hostent *hp;
    310312        struct PHB *phb = data;
    311         unsigned int len;
     313        socklen_t len;
    312314        int error = ETIMEDOUT;
    313315        if (phb->inpa > 0)
     
    501503        int i;
    502504        struct PHB *phb = data;
    503         unsigned int len;
     505        socklen_t len;
    504506        int error = ETIMEDOUT;
    505507        if (phb->inpa > 0)
Note: See TracChangeset for help on using the changeset viewer.