* Generate a new client entry, add it to the list, and return the * entry. Returns NULL if failed. */
| 1143 | * entry. Returns NULL if failed. |
| 1144 | */ |
| 1145 | static client_entry *gen_client(const request_rec *r) |
| 1146 | { |
| 1147 | unsigned long op; |
| 1148 | client_entry new_entry = { 0, NULL, 0, "" }, *entry; |
| 1149 | |
| 1150 | if (!opaque_cntr) { |
| 1151 | return NULL; |
| 1152 | } |
| 1153 | |
| 1154 | apr_global_mutex_lock(opaque_lock); |
| 1155 | op = (*opaque_cntr)++; |
| 1156 | apr_global_mutex_unlock(opaque_lock); |
| 1157 | |
| 1158 | if (!(entry = add_client(op, &new_entry, r->server))) { |
| 1159 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01769) |
| 1160 | "failed to allocate client entry - ignoring client"); |
| 1161 | return NULL; |
| 1162 | } |
| 1163 | |
| 1164 | return entry; |
| 1165 | } |
| 1166 | |
| 1167 | |
| 1168 | /* |
no test coverage detected