aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/msn_util.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-12-19 01:00:31 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2011-12-19 01:00:31 +0100
commit9b0ad7e8334c7c01e8d9652aa3b1aaa6c5f6d211 (patch)
tree09908d626161e333ce64cd636b0aaede502ce85f /protocols/msn/msn_util.c
parent64b663524a465efb7707a2c634be97b9fb6f963b (diff)
Moving msn_findheader() to lib/misc.c as get_rfc822_header() so I can use it
in OAuth as well. (Need it to find the Content-Type: header.)
Diffstat (limited to 'protocols/msn/msn_util.c')
-rw-r--r--protocols/msn/msn_util.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/protocols/msn/msn_util.c b/protocols/msn/msn_util.c
index 7fa68915..d5a74a47 100644
--- a/protocols/msn/msn_util.c
+++ b/protocols/msn/msn_util.c
@@ -227,58 +227,6 @@ void msn_buddy_ask( bee_user_t *bu )
imcb_ask( bu->ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no );
}
-char *msn_findheader( char *text, char *header, int len )
-{
- int hlen = strlen( header ), i;
- char *ret;
-
- if( len == 0 )
- len = strlen( text );
-
- i = 0;
- while( ( i + hlen ) < len )
- {
- /* Maybe this is a bit over-commented, but I just hate this part... */
- if( g_strncasecmp( text + i, header, hlen ) == 0 )
- {
- /* Skip to the (probable) end of the header */
- i += hlen;
-
- /* Find the first non-[: \t] character */
- while( i < len && ( text[i] == ':' || text[i] == ' ' || text[i] == '\t' ) ) i ++;
-
- /* Make sure we're still inside the string */
- if( i >= len ) return( NULL );
-
- /* Save the position */
- ret = text + i;
-
- /* Search for the end of this line */
- while( i < len && text[i] != '\r' && text[i] != '\n' ) i ++;
-
- /* Make sure we're still inside the string */
- if( i >= len ) return( NULL );
-
- /* Copy the found data */
- return( g_strndup( ret, text + i - ret ) );
- }
-
- /* This wasn't the header we were looking for, skip to the next line. */
- while( i < len && ( text[i] != '\r' && text[i] != '\n' ) ) i ++;
- while( i < len && ( text[i] == '\r' || text[i] == '\n' ) ) i ++;
-
- /* End of headers? */
- if( ( i >= 4 && strncmp( text + i - 4, "\r\n\r\n", 4 ) == 0 ) ||
- ( i >= 2 && ( strncmp( text + i - 2, "\n\n", 2 ) == 0 ||
- strncmp( text + i - 2, "\r\r", 2 ) == 0 ) ) )
- {
- break;
- }
- }
-
- return( NULL );
-}
-
/* *NOT* thread-safe, but that's not a problem for now... */
char **msn_linesplit( char *line )
{