Changes in lib/misc.c [eded1f7:e9b755e]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/misc.c
reded1f7 re9b755e 44 44 #include <resolv.h> 45 45 #endif 46 47 #include "ssl_client.h"48 46 49 47 void strip_linefeed(gchar *text) … … 324 322 } 325 323 326 /* Wrap an IPv4 address into IPv6 space. Not thread-safe... */327 char *ipv6_wrap( char *src )328 {329 static char dst[64];330 int i;331 332 for( i = 0; src[i]; i ++ )333 if( ( src[i] < '0' || src[i] > '9' ) && src[i] != '.' )334 break;335 336 /* Hmm, it's not even an IP... */337 if( src[i] )338 return src;339 340 g_snprintf( dst, sizeof( dst ), "::ffff:%s", src );341 342 return dst;343 }344 345 /* Unwrap an IPv4 address into IPv6 space. Thread-safe, because it's very simple. :-) */346 char *ipv6_unwrap( char *src )347 {348 int i;349 350 if( g_strncasecmp( src, "::ffff:", 7 ) != 0 )351 return src;352 353 for( i = 7; src[i]; i ++ )354 if( ( src[i] < '0' || src[i] > '9' ) && src[i] != '.' )355 break;356 357 /* Hmm, it's not even an IP... */358 if( src[i] )359 return src;360 361 return ( src + 7 );362 }363 364 324 /* Convert from one charset to another. 365 325 … … 593 553 return g_string_free( ret, FALSE ); 594 554 } 595 596 gboolean ssl_sockerr_again( void *ssl )597 {598 if( ssl )599 return ssl_errno == SSL_AGAIN;600 else601 return sockerr_again();602 }
Note: See TracChangeset
for help on using the changeset viewer.