# HG changeset patch # User Olaf Wintermann # Date 1732900226 -3600 # Node ID f19fd264c69c00f50cba800ad19ecbc0eaa7f619 # Parent 6ca97c99173e0eb8d0f6db84e6be2692cb230b57 fix wrong column name usage by pg prop extensions diff -r 6ca97c99173e -r f19fd264c69c src/server/plugins/postgresql/vfs.c --- a/src/server/plugins/postgresql/vfs.c Wed Nov 27 23:00:07 2024 +0100 +++ b/src/server/plugins/postgresql/vfs.c Fri Nov 29 18:10:26 2024 +0100 @@ -846,7 +846,7 @@ off_t pg_vfs_io_seek(SYS_FILE fd, off_t offset, int whence) { PgVFS *pgvfs = fd->ctx->vfs->instance; PgFile *pg = fd->data; - if(pg->fd < 0) return-1; + if(pg->fd < 0) return-1; return lo_lseek64(pgvfs->connection, pg->fd, offset, whence); } diff -r 6ca97c99173e -r f19fd264c69c src/server/plugins/postgresql/webdav.c --- a/src/server/plugins/postgresql/webdav.c Wed Nov 27 23:00:07 2024 +0100 +++ b/src/server/plugins/postgresql/webdav.c Fri Nov 29 18:10:26 2024 +0100 @@ -604,7 +604,9 @@ PgPropfindExtCol *c = &ext[i]; //c->field_num = PQfnumber(result, c->ext->column); int *fieldnum = cxMapGet(fieldmap, c->ext->column); - c->field_num = *fieldnum; + if(fieldnum) { + c->field_num = *fieldnum; + } } cxMapDestroy(fieldmap); @@ -736,7 +738,7 @@ PgPropfindExtCol ext = pg->ext[extc]; int fieldnum = ext.field_num; - if(!PQgetisnull(result, r, fieldnum)) { + if(fieldnum >= 0 && !PQgetisnull(result, r, fieldnum)) { char *ext_value = PQgetvalue(result, r, fieldnum); int ext_value_len = PQgetlength(result, r, fieldnum); char ext_xmlns_prefix[32]; @@ -1217,7 +1219,7 @@ } pg_params[i] = value_str; - cx_bprintf(sql, " %s = $%d,\n", prop->column->name, ++i); + cx_bprintf(sql, " %s = $%d,\n", prop->column->column, ++i); } for(PgProppatchExtProp *prop=ext->remove_begin;prop;prop=prop->next) { diff -r 6ca97c99173e -r f19fd264c69c src/server/safs/service.c --- a/src/server/safs/service.c Wed Nov 27 23:00:07 2024 +0100 +++ b/src/server/safs/service.c Fri Nov 29 18:10:26 2024 +0100 @@ -111,7 +111,7 @@ // TODO: check if vfs can seek pblock_kvinsert(pb_key_accept_ranges, "bytes", 5, rq->srvhdrs); - // start response + // everything ok for now protocol_status(sn, rq, 200, NULL); return fd;