crossroads

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

setversion.cc (410B)


      1 #include "httpbuffer"
      2 
      3 bool Httpbuffer::setversion (char v) {
      4     PROFILE("Httpbuffer::setversion");
      5 
      6     // No first line? Nothing to do yet.
      7     unsigned croff = charfind('\n');
      8     if (!croff)
      9 	return false;
     10 
     11     // Find the HTTP/1.x header
     12     unsigned stroff = strfind("HTTP/1.");
     13     if (!stroff || stroff > croff)
     14 	return false;
     15     
     16     // Poke in the new version.
     17     return setchar(stroff + 7, v);
     18 }