summaryrefslogtreecommitdiffstats
path: root/source/lib/data_blob.c
Commit message (Collapse)AuthorAgeFilesLines
* r11593: added a data_blob_realloc() functionAndrew Tridgell2005-11-091-0/+12
|
* r10479: Apply some constVolker Lendecke2005-09-241-2/+4
|
* r6980: added data_blob_append(), which I use in the web serverAndrew Tridgell2005-05-261-0/+13
|
* r6528: - in tdb_fetch() we effectively disallowed zero length records byAndrew Tridgell2005-04-301-1/+1
| | | | | | | | | | | | | | | | | | returning NULL/0, which is the same as we used for a failure. Having to look at tdb->ecode (which we never do) is too error prone. Instead, tdb_fetch() should behave like malloc() and talloc(), where zero length is not special and malloc(0) returns a valid pointer. - similarly in data_blob(), asking for data_blob(NULL, 0) should return a zero blob, but asking for data_blob(ptr, 0) should return a zero length blob with a valid pointer, just like talloc() and malloc() This change fixes the SummaryInformation stream stored in the tdb backend when manipulated from w2k. The w2k client was using SET_EOF_INFORMATION to create a zero-length stream, which we return STATUS_NOT_FOUND on, as the tdb_fetch() gave us back a NULL/0 blob, which we returned as not-found
* r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for theAndrew Tridgell2005-01-271-1/+1
| | | | | large commit. I thought this was worthwhile to get done for consistency.
* r4549: got rid of a lot more uses of plain talloc(), instead usingAndrew Tridgell2005-01-061-1/+1
| | | | | | | talloc_size() or talloc_array_p() where appropriate. also fixed a memory leak in pvfs_copy_file() (failed to free a memory context)
* r4327: add usefull function if you don't want that the data will ↵Stefan Metzmacher2004-12-211-0/+7
| | | | | | talloc_memdup()'ed metze
* r4263: added support for the trans2 RAW_SEARCH_EA_LIST informationAndrew Tridgell2004-12-181-0/+13
| | | | | | | | level. This is quite a strange level that we've never seen before, but is used by the os2 workplace shell. note w2k screws up this level when unicode is negotiated, so it only passes the RAW-SEARCH test when you force non-unicode
* r4027: add a useful function for debuggingStefan Metzmacher2004-12-011-0/+18
| | | | metze
* r3572: Thanks to tridge for his patience with my build breakage.Andrew Bartlett2004-11-061-3/+8
| | | | | | This concludes the proper fixes. Andrew Bartlett
* r3571: rough guesses at what abartlet really wanted to do in his last commitAndrew Tridgell2004-11-061-0/+12
| | | | | | (which I suspect was missing some pieces) this at least fixes the build so i can keep going on pvfs. Please review/fix Andrew.
* r2674: I have realised that talloc() should have its context marked const, asAndrew Tridgell2004-09-271-8/+3
| | | | | | | | | | | | | | | | | | | | | | | a const pointer really means that "the data pointed to by this pointer won't change", and that is certainly true of talloc(). The fact that some behind-the-scenes meta-data can change doesn't matter from the point of view of const. this fixes a number of const warnings caused by const data structures being passed as talloc contexts. That will no longer generate a warning. also changed the talloc leak reporting option from --leak-check to --leak-report, as all it does is generate a report on exit. A new --leak-report-full option has been added that shows the complete tree of memory allocations, which is is quite useful in tracking things down. NOTE: I find it quite useful to insert talloc_report_full(ptr, stderr) calls at strategic points in the code while debugging memory allocation problems, particularly before freeing a major context (such as the connection context). This allows you to see if that context has been accumulating too much data, such as per-request data, which should have been freed when the request finished.
* r2653: - data_blob() and data_blob_talloc() now get automatic namesAndrew Tridgell2004-09-261-1/+2
| | | | - talloc_strdup() and related functions get automatic names
* r2649: - used some cpp tricks to make users of talloc() and talloc_realloc()Andrew Tridgell2004-09-261-0/+5
| | | | | | | | | | | | | | | | | | | | | to get auto-naming of pointers very cheaply. - fixed a couple of memory leaks found with the new tricks A typical exit report for smbd is now: talloc report on 'null_context' (total 811 bytes in 54 blocks) auth/auth_sam.c:334 contains 20 bytes in 1 blocks struct auth_serversupplied_info contains 498 bytes in 33 blocks UNNAMED contains 8 bytes in 1 blocks lib/data_blob.c:40 contains 16 bytes in 1 blocks iconv(CP850,UTF8) contains 61 bytes in 4 blocks iconv(UTF8,CP850) contains 61 bytes in 4 blocks iconv(UTF8,UTF-16LE) contains 67 bytes in 4 blocks iconv(UTF-16LE,UTF8) contains 67 bytes in 4 blocks UNNAMED contains 13 bytes in 1 blocks which is much better than before
* r2043: data_blob() now returns a talloc'd pointer. If everyone has beenAndrew Tridgell2004-08-251-40/+10
| | | | | | | | following the data_blob() API properly then this will cause no problems. I'm expecting chaos. this is part of the general move towards using talloc for everything in samba4
* r2039: got rid of the free() ptr in DATA_BLOBAndrew Tridgell2004-08-251-17/+2
| | | | | | | | I plan on replacing the concept by adding a generic destructor in all talloc ptrs, so you can do: talloc_set_destructor(ptr, my_destructor); to setup a function that will be called on free.
* r1983: a completely new implementation of tallocAndrew Tridgell2004-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This version does the following: 1) talloc_free(), talloc_realloc() and talloc_steal() lose their (redundent) first arguments 2) you can use _any_ talloc pointer as a talloc context to allocate more memory. This allows you to create complex data structures where the top level structure is the logical parent of the next level down, and those are the parents of the level below that. Then destroy either the lot with a single talloc_free() or destroy any sub-part with a talloc_free() of that part 3) you can name any pointer. Use talloc_named() which is just like talloc() but takes the printf style name argument as well as the parent context and the size. The whole thing ends up being a very simple piece of code, although some of the pointer walking gets hairy. So far, I'm just using the new talloc() like the old one. The next step is to actually take advantage of the new interface properly. Expect some new commits soon that simplify some common coding styles in samba4 by using the new talloc().
* r1452: Thanks to Volker for spotting that this code was certainly not tested...Andrew Bartlett2004-07-111-0/+1
| | | | | | (make sure to actually return the result). Andrew Bartlett
* r1435: talloc_steal is very useful - add a function to do it with a DATA_BLOBAndrew Bartlett2004-07-111-0/+15
| | | | Andrew Bartlett
* r607: When our code is looking for an 'empty' data blobAndrew Bartlett2004-05-091-0/+1
| | | | | | | | | | some of it tests the .length, other code checks the .data. Ensure that we always NULL the .data, so that talloc-based blobs behave just like their direct malloc equivalents. Andrew Bartlett
* r6: merge in the samba4 HEAD branch from cvsCVS Import User2004-04-041-9/+48
| | | | | | | | to checkout try: svn co svn+ssh://svn.samba.org/home/svn/samba/branches/SAMBA_4_0 metze
* r2: import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunkCVS Import User2004-04-041-0/+115
metze