# # # patch "packet.cc" # from [35ad4a2b884b276ff41d03d4efd9fb6e9b62d048] # to [184a7b3bd2cae1a2773fba3b7d4514334ac51126] # ============================================================ --- packet.cc 35ad4a2b884b276ff41d03d4efd9fb6e9b62d048 +++ packet.cc 184a7b3bd2cae1a2773fba3b7d4514334ac51126 @@ -178,7 +178,17 @@ feed_packet_consumer file_id(hexenc(dst_id)), file_delta(contents)); } - + static void read_rest(istream& in, string& dest) + { + + while( true ) + { + string t; + in >> t; + if( t.size() == 0 ) break; + dest += t; + } + } void rcert_packet(string const & args, string const & body) const { L(FL("read cert packet")); @@ -186,8 +196,8 @@ feed_packet_consumer string certid; iss >> certid; validate_id(certid); string name; iss >> name; validate_certname(name); string keyid; iss >> keyid; validate_key(keyid); - string val; iss >> val; validate_base64(val); - validate_no_more_args(iss); + string val; + read_rest(iss,val); validate_base64(val); validate_base64(body); // canonicalize the base64 encodings to permit searches cert t = cert(hexenc(certid), @@ -242,7 +252,7 @@ feed_packet_consumer { if (type == "rdata") data_packet(args, body, true); - if (type == "fdata") + else if (type == "fdata") data_packet(args, body, false); else if (type == "fdelta") fdelta_packet(args, body);