- Timestamp:
- Apr 21, 2009, 1:28:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/RpEncode.cc
r1410 r1413 207 207 bytes = buf.bytes(); 208 208 if ((flags & RPENC_RAW) == 0) { 209 unsigned int headerFlags = 0; 209 210 if ((size > 11) && (strncmp(bytes, "@@RP-ENC:z\n", 11) == 0)) { 210 211 bytes += 11; 211 212 size -= 11; 212 flags &= ~RPENC_B64; 213 flags |= RPENC_Z; 213 headerFlags |= RPENC_Z; 214 214 } else if ((size > 13) && (strncmp(bytes, "@@RP-ENC:b64\n", 13) == 0)){ 215 215 bytes += 13; 216 216 size -= 13; 217 flags &= ~RPENC_Z; 218 flags |= RPENC_B64; 217 headerFlags |= RPENC_B64; 219 218 } else if ((size > 14) && (strncmp(bytes, "@@RP-ENC:zb64\n", 14) == 0)){ 220 219 bytes += 14; 221 220 size -= 14; 222 flags |= (RPENC_B64 | RPENC_Z);221 headerFlags |= (RPENC_B64 | RPENC_Z); 223 222 } 223 if (headerFlags != 0) { 224 unsigned int reqFlags; 225 226 reqFlags = flags & (RPENC_B64 | RPENC_Z); 227 /* 228 * If there's a header and the programmer also requested decoding 229 * flags, verify that the two are the same. We don't want to 230 * penalize the programmer for over-specifying. But we need to 231 * catch cases when they don't match. If you really want to 232 * override the header, you should also specify the RPENC_RAW flag 233 * (-noheader). 234 */ 235 if ((reqFlags != 0) && (reqFlags != headerFlags)) { 236 status.addError("decode flags don't match the header"); 237 return false; 238 } 239 flags |= headerFlags; 240 } 224 241 } 225 242 if ((flags & (RPENC_B64 | RPENC_Z)) == 0) {
Note: See TracChangeset
for help on using the changeset viewer.