Lines Matching refs:ptr
119 format_field **ptr; member
160 char *ptr, *start, *end; in accesslog_append_escaped() local
167 for (ptr = start = str->ptr, end = str->ptr + str->used - 1; ptr < end; ptr++) { in accesslog_append_escaped()
168 char const c = *ptr; in accesslog_append_escaped()
173 if (start < ptr) { in accesslog_append_escaped()
174 buffer_append_string_len(dest, start, ptr - start); in accesslog_append_escaped()
176 start = ptr + 1; in accesslog_append_escaped()
225 switch(format->ptr[i]) { in accesslog_parse_format()
232 fields->ptr = malloc(fields->size * sizeof(format_field * )); in accesslog_parse_format()
235 fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * )); in accesslog_parse_format()
238 fields->ptr[fields->used] = malloc(sizeof(format_field)); in accesslog_parse_format()
239 fields->ptr[fields->used]->type = FIELD_STRING; in accesslog_parse_format()
240 fields->ptr[fields->used]->string = buffer_init(); in accesslog_parse_format()
242 buffer_copy_string_len(fields->ptr[fields->used]->string, format->ptr + start, i - start); in accesslog_parse_format()
252 fields->ptr = malloc(fields->size * sizeof(format_field * )); in accesslog_parse_format()
255 fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * )); in accesslog_parse_format()
259 switch (format->ptr[i+1]) { in accesslog_parse_format()
263 if (format->ptr[i+2] == '\0') { in accesslog_parse_format()
270 if (fmap[j].key != format->ptr[i+2]) continue; in accesslog_parse_format()
274 fields->ptr[fields->used] = malloc(sizeof(format_field)); in accesslog_parse_format()
275 fields->ptr[fields->used]->type = FIELD_FORMAT; in accesslog_parse_format()
276 fields->ptr[fields->used]->field = fmap[j].type; in accesslog_parse_format()
277 fields->ptr[fields->used]->string = NULL; in accesslog_parse_format()
297 if (format->ptr[k] == '}') break; in accesslog_parse_format()
306 if (format->ptr[k+1] == '\0') { in accesslog_parse_format()
317 if (fmap[j].key != format->ptr[k+1]) continue; in accesslog_parse_format()
321 fields->ptr[fields->used] = malloc(sizeof(format_field)); in accesslog_parse_format()
322 fields->ptr[fields->used]->type = FIELD_FORMAT; in accesslog_parse_format()
323 fields->ptr[fields->used]->field = fmap[j].type; in accesslog_parse_format()
324 fields->ptr[fields->used]->string = buffer_init(); in accesslog_parse_format()
326 buffer_copy_string_len(fields->ptr[fields->used]->string, format->ptr + i + 2, k - (i + 2)); in accesslog_parse_format()
344 if (format->ptr[i+1] == '\0') { in accesslog_parse_format()
350 if (fmap[j].key != format->ptr[i+1]) continue; in accesslog_parse_format()
354 fields->ptr[fields->used] = malloc(sizeof(format_field)); in accesslog_parse_format()
355 fields->ptr[fields->used]->type = FIELD_FORMAT; in accesslog_parse_format()
356 fields->ptr[fields->used]->field = fmap[j].type; in accesslog_parse_format()
357 fields->ptr[fields->used]->string = NULL; in accesslog_parse_format()
384 fields->ptr = malloc(fields->size * sizeof(format_field * )); in accesslog_parse_format()
387 fields->ptr = realloc(fields->ptr, fields->size * sizeof(format_field * )); in accesslog_parse_format()
390 fields->ptr[fields->used] = malloc(sizeof(format_field)); in accesslog_parse_format()
391 fields->ptr[fields->used]->type = FIELD_STRING; in accesslog_parse_format()
392 fields->ptr[fields->used]->string = buffer_init(); in accesslog_parse_format()
394 buffer_copy_string_len(fields->ptr[fields->used]->string, format->ptr + start, i - start); in accesslog_parse_format()
419 syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr); in FREE_FUNC()
423 write(s->log_access_fd, s->access_logbuffer->ptr, s->access_logbuffer->used - 1); in FREE_FUNC()
438 if (s->parsed_format->ptr[j]->string) buffer_free(s->parsed_format->ptr[j]->string); in FREE_FUNC()
439 free(s->parsed_format->ptr[j]); in FREE_FUNC()
441 free(s->parsed_format->ptr); in FREE_FUNC()
522 if (FIELD_FORMAT == s->parsed_format->ptr[j]->type) { in SETDEFAULTS_FUNC()
523 if (FORMAT_TIMESTAMP == s->parsed_format->ptr[j]->field) { in SETDEFAULTS_FUNC()
524 if (!buffer_is_empty(s->parsed_format->ptr[j]->string)) { in SETDEFAULTS_FUNC()
525 buffer_copy_string(s->ts_accesslog_fmt_str, s->parsed_format->ptr[j]->string->ptr); in SETDEFAULTS_FUNC()
541 switch (s->parsed_format->ptr[j]->type) { in SETDEFAULTS_FUNC()
544 "config:", "format", s->parsed_format->ptr[j]->field, in SETDEFAULTS_FUNC()
545 s->parsed_format->ptr[j]->string ? in SETDEFAULTS_FUNC()
546 s->parsed_format->ptr[j]->string->ptr : "" ); in SETDEFAULTS_FUNC()
549 …log_error_write(srv, __FILE__, __LINE__, "ssbs", "config:", "string '", s->parsed_format->ptr[j]->… in SETDEFAULTS_FUNC()
575 if (-1 == (s->log_access_fd = open_logfile_or_pipe(srv, s->access_logfile->ptr))) in SETDEFAULTS_FUNC()
597 syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr); in SIGHUP_FUNC()
601 write(s->log_access_fd, s->access_logbuffer->ptr, s->access_logbuffer->used - 1); in SIGHUP_FUNC()
609 s->access_logfile->ptr[0] != '|') { in SIGHUP_FUNC()
614 open(s->access_logfile->ptr, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE, 0644))) { in SIGHUP_FUNC()
699 switch(p->conf.parsed_format->ptr[j]->type) { in REQUESTDONE_FUNC()
701 buffer_append_string_buffer(b, p->conf.parsed_format->ptr[j]->string); in REQUESTDONE_FUNC()
704 switch(p->conf.parsed_format->ptr[j]->field) { in REQUESTDONE_FUNC()
718 …strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_f… in REQUESTDONE_FUNC()
720 …strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_f… in REQUESTDONE_FUNC()
722 p->conf.ts_accesslog_str->used = strlen(p->conf.ts_accesslog_str->ptr) + 1; in REQUESTDONE_FUNC()
742 …strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_f… in REQUESTDONE_FUNC()
744 …strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_f… in REQUESTDONE_FUNC()
746 p->conf.ts_accesslog_str->used = strlen(p->conf.ts_accesslog_str->ptr) + 1; in REQUESTDONE_FUNC()
792 …ta_string *)array_get_element(con->request.headers, p->conf.parsed_format->ptr[j]->string->ptr))) { in REQUESTDONE_FUNC()
799 …a_string *)array_get_element(con->response.headers, p->conf.parsed_format->ptr[j]->string->ptr))) { in REQUESTDONE_FUNC()
806 … (data_string *)array_get_element(con->environment, p->conf.parsed_format->ptr[j]->string->ptr))) { in REQUESTDONE_FUNC()
864 if (srvtoken->ptr[0] == '[') { in REQUESTDONE_FUNC()
865 colon = strstr(srvtoken->ptr, "]:"); in REQUESTDONE_FUNC()
867 colon = strchr(srvtoken->ptr, ':'); in REQUESTDONE_FUNC()
907 … (p->conf.access_logfile->used && p->conf.access_logfile->ptr[0] == '|') || /* pipes don't cache */ in REQUESTDONE_FUNC()
914 syslog(LOG_INFO, "%*s", (int) b->used - 2, b->ptr); in REQUESTDONE_FUNC()
918 write(p->conf.log_access_fd, b->ptr, b->used - 1); in REQUESTDONE_FUNC()