crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs

httpheaderval.c (846B)


      1 /*************************************************************************
      2  * This file is part of Crosroads 1.23, a load balancer and fail over
      3  * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL.
      4  * Visit http://crossroads.e-tunity.com for information.
      5  *************************************************************************/
      6 #include "crossroads.h"
      7 
      8 unsigned char const *http_header_val (HttpHeader *m, char const *what) {
      9     unsigned char const *ret;
     10 
     11     int i;
     12 
     13     for (i = 0; i < m->nheader; i++) {
     14 	// msg ("Scanning header %s for %s", m->header[i], what);
     15 	if (m->header[i] && !strncasecmp (m->header[i], what, strlen(what))) {
     16 	    ret = (unsigned char const *) m->header[i] + strlen(what);
     17 	    if (*ret == ':') {
     18 		ret++;
     19 		while (is_space (*ret))
     20 		    ret++;
     21 		return (ret);
     22 	    }
     23 	}
     24     }
     25 
     26     return (0);
     27 }