Changeset 63
- Timestamp:
- Sep 4, 2009, 7:30:35 PM (15 years ago)
- Location:
- trunk/source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/source/Makefile.kmk ¶
r60 r63 28 28 ndpdav.def \ 29 29 printf.c \ 30 util.cpp \ 30 31 dav/dav_alloc.cpp \ 31 32 dav/dav_encode.cpp \ -
TabularUnified trunk/source/ndp.cpp ¶
r61 r63 3 3 * http://www.blueprintsoftwareworks.com 4 4 * Copyright (c) 2005 Vitali E. Pelenyov 5 * Copyright (c) 2009 Yuri Dario, netlabs.org 5 6 * 6 7 * Permission is hereby granted, free of charge, to any person obtaining … … 33 34 34 35 #include "resource.hpp" 36 #include "util.hpp" 35 37 36 38 const NDPROPERTYINFO Properties[] = … … 424 426 const char *fullpath; 425 427 426 LOG((ND_LL_DEBUG, " NdpSetPathInfo: conn=%p, pfiSrc = %p, src = %s\r\n", conn, pfi, szPathName));428 LOG((ND_LL_DEBUG, ">NdpSetPathInfo: conn=%p, pfiSrc = %p, src = %s\r\n", conn, pfi, szPathName)); 427 429 428 430 NdPathInfo pathinfo(&pfi->stat, pel->name, pel->length); … … 453 455 { 454 456 rc = pConn->SetPathInfo (fullpath, &pathinfo); 455 LOG((ND_LL_DEBUG, "NdpSetPathInfo: rc = %d, conn = %p, path = %s\r\n", rc, conn, szPathName));456 457 pConn->GetResource()->ReleaseFullPath (fullpath); 457 458 } 458 459 } 460 461 LOG((ND_LL_DEBUG, "<NdpSetPathInfo: rc = %d, conn = %p, path = %s\r\n", rc, conn, szPathName)); 459 462 460 463 return rc; … … 1120 1123 1121 1124 const char *fullpath = pConn->GetResource()->QueryFullPath (szFileName); 1122 1125 1126 LOG((ND_LL_DEBUG, ">NdpSetFileAttribute: conn=%p: pfi = %p: path = %s\r\n", conn, pfi, szFileName)); 1127 1123 1128 if (!fullpath) 1124 1129 { … … 1142 1147 } 1143 1148 1144 LOG((ND_LL_DEBUG, " NdpSetFileAttribute: rc = %d, conn=%p: pfi = %p: path = %s\r\n", rc, conn, pfi, szFileName));1149 LOG((ND_LL_DEBUG, "<NdpSetFileAttribute: rc = %d, conn=%p: pfi = %p: path = %s\r\n", rc, conn, pfi, szFileName)); 1145 1150 1146 1151 return rc; … … 1215 1220 NdConnection *pConn = (NdConnection *)conn; 1216 1221 NdFile *file = (NdFile *)handle; 1222 1223 LOG((ND_LL_DEBUG, ">NdpFileSetInfo: conn=%p: pfi = %p\r\n", conn, pfi)); 1217 1224 1218 1225 NdPathInfo pathinfo(&pfi->stat, file->Name (), file->NameLength ()); 1219 1226 1220 return pConn->SetPathInfo (file->FullName (), &pathinfo); 1227 int rc = pConn->SetPathInfo (file->FullName (), &pathinfo); 1228 1229 LOG((ND_LL_DEBUG, "<NdpFileSetInfo: conn=%p: rc = %d\r\n", conn, rc)); 1230 1231 return rc; 1221 1232 } 1222 1233 … … 1376 1387 size = pstat->cbFile; 1377 1388 1378 ph->fsphDosDateToUnixTime (pstat->fdateCreation, pstat->ftimeCreation, (ULONG*)&ctime); 1379 ph->fsphDosDateToUnixTime (pstat->fdateLastWrite, pstat->ftimeLastWrite, (ULONG*)&mtime); 1389 fsphDosDateToUnixTime (pstat->fdateCreation, pstat->ftimeCreation, (ULONG*)&ctime); 1390 creationdate = ctime; 1391 fsphDosDateToUnixTime (pstat->fdateLastWrite, pstat->ftimeLastWrite, (ULONG*)&mtime); 1380 1392 } 1381 1393 … … 1423 1435 void NdPathInfo::toFILESTATUS3L (FILESTATUS3L *pstat) 1424 1436 { 1425 ph->fsphUnixTimeToDosDate (ctime, &pstat->fdateCreation, &pstat->ftimeCreation);1426 ph->fsphUnixTimeToDosDate (mtime, &pstat->fdateLastWrite, &pstat->ftimeLastWrite);1437 fsphUnixTimeToDosDate (ctime, &pstat->fdateCreation, &pstat->ftimeCreation); 1438 fsphUnixTimeToDosDate (mtime, &pstat->fdateLastWrite, &pstat->ftimeLastWrite); 1427 1439 pstat->fdateLastAccess = pstat->fdateLastWrite; 1428 1440 pstat->ftimeLastAccess = pstat->ftimeLastWrite; -
TabularUnified trunk/source/ndp.hpp ¶
r29 r63 3 3 * http://www.blueprintsoftwareworks.com 4 4 * Copyright (c) 2005 Vitali E. Pelenyov 5 * Copyright (c) 2009 Yuri Dario, netlabs.org 5 6 * 6 7 * Permission is hereby granted, free of charge, to any person obtaining -
TabularUnified trunk/source/resource.cpp ¶
r61 r63 3 3 * http://www.blueprintsoftwareworks.com 4 4 * Copyright (c) 2005 Vitali E. Pelenyov 5 * Copyright (c) 2009 Yuri Dario, netlabs.org 5 6 * 6 7 * Permission is hereby granted, free of charge, to any person obtaining … … 35 36 #include "ne_nd.h" 36 37 #include "version.h" 38 #include "util.hpp" 37 39 38 40 #if DEBUG … … 71 73 // obtain properties 72 74 #define PROPVAL(a) ne_propset_value(results, &querypathinfo_props[a]); 73 74 /* ISO8601: 2001-01-01T12:30:00Z */75 #define ISO8601_FORMAT_Z "%04d-%02d-%02dT%02d:%02d:%02dZ"76 77 /* Returns the time/date GMT, in ISO8601Z-type format: eg78 * 2001-01-01T12:30:00Z. */79 char *ne_iso8601z_date(time_t localtime) {80 FDATE nddate;81 FTIME ndtime;82 char* ret;83 84 // adjust time zone offset85 localtime += timezone;86 // convert to date&time87 ph->fsphUnixTimeToDosDate( localtime, &nddate, &ndtime);88 89 ret = (char*)ne_malloc(21 + 1);90 ne_snprintf(ret, 21, ISO8601_FORMAT_Z,91 nddate.year+1980, nddate.month, nddate.day,92 ndtime.hours, ndtime.minutes, ndtime.twosecs*2);93 94 return ret;95 }96 97 /* Takes an ISO-8601-formatted date string and returns the time_t.98 * Returns (time_t)-1 if the parse fails. */99 time_t ne_iso8601z_parse(const char *date)100 {101 NDTIMEDATE ndgmt;102 ULONG t;103 104 if (sscanf(date, ISO8601_FORMAT_Z,105 &ndgmt.year, &ndgmt.month, &ndgmt.day,106 &ndgmt.hours, &ndgmt.minutes, &ndgmt.seconds) != 6)107 {108 return (time_t)-1;109 }110 111 // convert to unix time112 ph->fsphTimeTimeDate2Unix( &ndgmt, &t);113 // adjust time zone offset114 t -= timezone;115 116 return t;117 }118 75 119 76 int ResourceInit (void) … … 666 623 if (value) 667 624 { 668 ppathinfo->ctime = ne_httpdate_parse(value); 625 ppathinfo->ctime = ne_iso8601z_parse(value); 626 LOG((ND_LL_DEBUG, "querypathinfo_callback: ctime PROP_CREATIONDATE=%s %d\n", value, ppathinfo->ctime)); 627 ppathinfo->creationdate = ppathinfo->ctime; 628 LOG((ND_LL_DEBUG, "querypathinfo_callback: creationdate PROP_CREATIONDATE=%s %d\n", value, ppathinfo->creationdate)); 669 629 } 670 630 … … 672 632 if (value) 673 633 { 674 ppathinfo->mtime = ne_httpdate_parse(value); 634 ppathinfo->mtime = ne_httpdate_parse_localtime(value); 635 LOG((ND_LL_DEBUG, "querypathinfo_callback: mtime PROP_GETLASTMODIFIED=%s %d\n", value, ppathinfo->mtime)); 675 636 } 676 637 … … 680 641 { 681 642 ppathinfo->ctime = ne_iso8601z_parse(value); 643 LOG((ND_LL_DEBUG, "querypathinfo_callback: ctime PROP_SRT_CREATIONTIME=%s %d\n", value, ppathinfo->ctime)); 682 644 } 683 645 … … 686 648 { 687 649 ppathinfo->mtime = ne_iso8601z_parse(value); 688 } 689 690 // get creationdate 691 value = PROPVAL(PROP_CREATIONDATE); 692 if (value) 693 { 694 ppathinfo->creationdate = ne_iso8601z_parse(value); 650 LOG((ND_LL_DEBUG, "querypathinfo_callback: mtime PROP_SRT_MODIFIEDTIME=%s %d\n", value, ppathinfo->mtime)); 695 651 } 696 652 … … 869 825 ppathinfo->creationdate >0 ? ppathinfo->creationdate : time(NULL)); 870 826 LOG((ND_LL_DEBUG, "Connection::SetPathInfo: path = %s\r\n", path)); 871 LOG((ND_LL_DEBUG, "Connection::SetPathInfo set time: %s\n", ops[0].value));872 LOG((ND_LL_DEBUG, "Connection::SetPathInfo set time: %s\n", ops[1].value));873 LOG((ND_LL_DEBUG, "Connection::SetPathInfo ppathinfo->creationdate: %d\n", ppathinfo->creationdate));827 LOG((ND_LL_DEBUG, "Connection::SetPathInfo mtime: %s %d\n", ops[0].value, ppathinfo->mtime)); 828 LOG((ND_LL_DEBUG, "Connection::SetPathInfo ctime: %s %d\n", ops[1].value, ppathinfo->ctime)); 829 LOG((ND_LL_DEBUG, "Connection::SetPathInfo creationdate: %s %d\n", ops[2].value, ppathinfo->creationdate)); 874 830 875 831 // set properties … … 878 834 879 835 // free res 880 ne_free( (void*) ops[0].value);881 ne_free( (void*) ops[1].value);882 ne_free( (void*) ops[2].value);836 free( (void*) ops[0].value); 837 free( (void*) ops[1].value); 838 free( (void*) ops[2].value); 883 839 884 840 if (rc) -
TabularUnified trunk/source/resource.hpp ¶
r34 r63 3 3 * http://www.blueprintsoftwareworks.com 4 4 * Copyright (c) 2005 Vitali E. Pelenyov 5 * Copyright (c) 2009 Yuri Dario, netlabs.org 5 6 * 6 7 * Permission is hereby granted, free of charge, to any person obtaining
Note:
See TracChangeset
for help on using the changeset viewer.