crossroads

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

httpheaderwrite.c (994B)


      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 void http_header_write (HttpHeader *m, int sock, CopyDirection dir) {
      9     int i;
     10 
     11     msg ("Service %s: Sending HTTP headers to %s",
     12 	 activeservice->name,
     13 	 dir == dir_server_to_client ? "client" : "server");
     14     
     15     for (i = 0; i < m->nheader; i++) {
     16 	if (! m->header[i] || ! *m->header[i])
     17 	    continue;
     18 	msg ("Service %s: sending header %d: '%s'",
     19 	     activeservice->name, i, m->header[i]);
     20 	http_write (sock, dir, (unsigned char const *) m->header[i],
     21 		    strlen(m->header[i]));
     22 	http_write (sock, dir, (unsigned char const *) "\r\n", 2);
     23     }
     24     http_write (sock, dir, (unsigned char const *) "\r\n", 2);
     25 }