Changes in lib/misc.c [e9b755e:eded1f7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/misc.c
re9b755e reded1f7 44 44 #include <resolv.h> 45 45 #endif 46 47 #include "ssl_client.h" 46 48 47 49 void strip_linefeed(gchar *text) … … 322 324 } 323 325 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 324 364 /* Convert from one charset to another. 325 365 … … 553 593 return g_string_free( ret, FALSE ); 554 594 } 595 596 gboolean ssl_sockerr_again( void *ssl ) 597 { 598 if( ssl ) 599 return ssl_errno == SSL_AGAIN; 600 else 601 return sockerr_again(); 602 }
Note: See TracChangeset
for help on using the changeset viewer.