| 58 |
58 |
| 59 #ifdef Z_DEBUG |
59 #ifdef Z_DEBUG |
| 60 void (*__Z_debug_print) __P((const char *fmt, va_list args, void *closure)); |
60 void (*__Z_debug_print) __P((const char *fmt, va_list args, void *closure)); |
| 61 void *__Z_debug_print_closure; |
61 void *__Z_debug_print_closure; |
| 62 #endif |
62 #endif |
| 63 |
|
| 64 #define min(a,b) ((a)<(b)?(a):(b)) |
|
| 65 |
63 |
| 66 static int Z_AddField __P((char **ptr, const char *field, char *end)); |
64 static int Z_AddField __P((char **ptr, const char *field, char *end)); |
| 67 static int find_or_insert_uid __P((ZUnique_Id_t *uid, ZNotice_Kind_t kind)); |
65 static int find_or_insert_uid __P((ZUnique_Id_t *uid, ZNotice_Kind_t kind)); |
| 68 |
66 |
| 69 /* Find or insert uid in the old uids buffer. The buffer is a sorted |
67 /* Find or insert uid in the old uids buffer. The buffer is a sorted |
| 888 partnotice.z_uid.tv.tv_usec = |
886 partnotice.z_uid.tv.tv_usec = |
| 889 htonl((unsigned long) partnotice.z_uid.tv.tv_usec); |
887 htonl((unsigned long) partnotice.z_uid.tv.tv_usec); |
| 890 (void) memcpy((char *)&partnotice.z_uid.zuid_addr, &__My_addr, |
888 (void) memcpy((char *)&partnotice.z_uid.zuid_addr, &__My_addr, |
| 891 sizeof(__My_addr)); |
889 sizeof(__My_addr)); |
| 892 } |
890 } |
| 893 message_len = min(notice->z_message_len-offset, fragsize); |
891 message_len = MIN(notice->z_message_len - offset, fragsize); |
| 894 partnotice.z_message = (char*)notice->z_message+offset; |
892 partnotice.z_message = (char*)notice->z_message+offset; |
| 895 partnotice.z_message_len = message_len; |
893 partnotice.z_message_len = message_len; |
| 896 if ((retval = Z_FormatAuthHeader(&partnotice, buffer, Z_MAXHEADERLEN, |
894 if ((retval = Z_FormatAuthHeader(&partnotice, buffer, Z_MAXHEADERLEN, |
| 897 &ret_len, cert_func)) != ZERR_NONE) { |
895 &ret_len, cert_func)) != ZERR_NONE) { |
| 898 return (retval); |
896 return (retval); |