Who know "Remote Debug"

linuswu 2003-10-17 05:46:13
My leader tell me a debug way about "Remote Debug", he said it a tool of VC++, but I know nothing about it, who can tell me anything about it?
...全文
65 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangweintk 2003-11-13
  • 打赏
  • 举报
回复
http://www.cl.cam.ac.uk/Research/SRG/bluebook/17/rdebug/rdebug.html

maybe you can get something available...
linuswu 2003-11-13
  • 打赏
  • 举报
回复
I use two PC with English XP OS, one is my developing machine, another is for testing, it's clean before. When I debugging, it always tell me that"C:\windows\system32\ntdll.dll" does not match the corresponding file on the remote machine. But I have copied it from my pc to the remote pc, who tell me its reason ? It's urgent!!!
Fred_Mark 2003-10-17
  • 打赏
  • 举报
回复
同意
FlyYang 2003-10-17
  • 打赏
  • 举报
回复
在你的vs安装目录下的Common\MSDev98\Bin\MSVCMON.EXE
如果是vs.net开始菜单里面就有
自己试着用一下就知道了

---------
++C++
---------
flyingFisher 2003-10-17
  • 打赏
  • 举报
回复
UP
https://github.com/iBotPeaches/Apktool Introduction Basic First lets take a lesson into apk files. apks are nothing more than a zip file containing resources and compiled java. If you were to simply unzip an apk like so, you would be left with files such as classes.dex and resources.arsc. $ unzip testapp.apk Archive: testapp.apk inflating: AndroidManifest.xml inflating: classes.dex extracting: res/drawable-hdpi/ic_launcher.png inflating: res/xml/literals.xml inflating: res/xml/references.xml extracting: resources.arsc However, at this point you have simply inflated compiled sources. If you tried to view AndroidManifest.xml. You'd be left viewing this. P4F0\fnversionCodeversionNameandroid*http://schemas.android.com/apk/res/androidpackageplatformBuildVersionCodeplatformBuildVersionNamemanifestbrut.apktool.testapp1.021APKTOOL Obviously, editing or viewing a compiled file is next to impossible. That is where Apktool comes into play. $ apktool d testapp.apk I: Using Apktool 2.0.0 on testapp.apk I: Loading resource table... I: Decoding AndroidManifest.xml with resources... I: Loading resource table from file: 1.apk I: Regular manifest package... I: Decoding file-resources... I: Decoding values */* XMLs... I: Baksmaling classes.dex... I: Copying assets and libs... $ Viewing AndroidManifest.xml again results in something much more human readable In addition to XMLs, resources such as 9 patch images, layouts, strings and much more are correctly decoded to source form. Decoding The decode option on Apktool can be invoked either from d or decode like shown below. $ apktool d foo.jar // decodes foo.jar to foo.jar.out folder $ apktool decode foo.jar // decodes foo.jar to foo.jar.out folder $ apktool d bar.apk // decodes bar.apk to bar folder $ apktool decode bar.apk // decodes bar.apk to bar folder $ apktool d bar.apk -o baz // decodes bar.apk to baz folder Building The build option can be invoked either from b or build like shown below $ apktool b foo.jar.out // builds foo.jar.out folder into foo.jar.out/dist/foo.jar file $ apktool build foo.jar.out // builds foo.jar.out folder into foo.jar.out/dist/foo.jar file $ apktool b bar // builds bar folder into bar/dist/bar.apk file $ apktool b . // builds current directory into ./dist $ apktool b bar -o new_bar.apk // builds bar folder into new_bar.apk $ apktool b bar.apk // WRONG: brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml // Must use folder, not apk/jar file InfoIn order to run a rebuilt application. You must resign the application. Android documentation can help with this. Frameworks Frameworks can be installed either from if or install-framework, in addition two parameters -p, --frame-path - Store framework files into -t, --tag - Tag frameworks using Allow for a finer control over how the files are named and how they are stored. $ apktool if framework-res.apk I: Framework installed to: 1.apk // pkgId of framework-res.apk determines number (which is 0x01) $ apktool if com.htc.resources.apk I: Framework installed to: 2.apk // pkgId of com.htc.resources is 0x02 $ apktool if com.htc.resources.apk -t htc I: Framework installed to: 2-htc.apk // pkgId-tag.apk $ apktool if framework-res.apk -p foo/bar I: Framework installed to: foo/bar/1.apk $ apktool if framework-res.apk -t baz -p foo/bar I: Framework installed to: foo/bar/1-baz.apk Migration Instructions v2.1.1 -> v2.2.0 Run the following commands to migrate your framework directory Apktool will work fine without running these commands, this will just cleanup abandoned files unix - mkdir -p ~/.local/share; mv ~/apktool ~/.local/share windows - move %USERPROFILE%\apktool %USERPROFILE%\AppData\Local v2.0.1 -> v2.0.2 Update apktool to v2.0.2 Remove framework file $HOME/apktool/framework/1.apk due to internal API update (Android Marshmallow) v1.5.x -> v2.0.0 Java 1.7 is required Update apktool to v2.0.0 aapt is now included inside the apktool binary. It's not required to maintain your own aapt install under $PATH. (However, features like -a / --aapt are still used and can override the internal aapt) The addition of aapt replaces the need for separate aapt download packages. Helper Scripts may be found here Remove framework $HOME/apktool/framework/1.apk Eagle eyed users will notice resources are now decoded before sources now. This is because we need to know the API version via the manifest for decoding the sources Parameter Changes Smali/baksmali 2.0 are included. This is a big change from 1.4.2. Please read the smali updates here for more information -o / --output is now used for the output of apk/directory -t / --tag is required for tagging framework files -advance / --advanced will launch advance parameters and information on the usage output -m / --match-original is a new feature for apk analysis. This retains the apk is nearly original format, but will make rebuild more than likely not work due to ignoring the changes that newer aapt requires After [d]ecode, there will be new folders (original / unknown) in the decoded apk folder original = META-INF folder / AndroidManifest.xml, which are needed to retain the signature of apks to prevent needing to resign. Used with -c / --copy-original on [b]uild unknown = Files / folders that are not part of the standard AOSP build procedure. These files will be injected back into the rebuilt APK. apktool.yml collects more information than last version SdkInfo - Used to repopulate the sdk information in AndroidManifest.xml since newer aapt requires version information to be passed via parameter packageInfo - Used to help support Android 4.2 renamed manifest feature. Automatically detects differences between resource and manifest and performs automatic --rename-manifest-package on [b]uild versionInfo - Used to repopulate the version information in AndroidManifest.xml since newer aapt requires version information to be passed via parameter compressionType - Used to determine the compression that resources.arsc had on the original apk in order to replicate during [b]uild unknownFiles - Used to record name/location of non-standard files in an apk in order to place correctly on rebuilt apk sharedLibrary - Used to help support Android 5 shared library feature by automatically detecting shared libraries and using --shared-lib on [b]uild Examples of new usage in 2.0 vs 1.5.x Old (Apktool 1.5.x) New (Apktool 2.0.x) apktool if framework-res.apk tag apktool if framework-res.apk -t tag apktool d framework-res.apk output apktool d framework.res.apk -o output apktool b output new.apk apktool b output -o new.apk v1.4.x -> v1.5.1 Update apktool to v1.5.1 Update aapt manually or use package r05-ibot via downloading Mac, Windows or Linux Remove framework file $HOME/apktool/framework/1.apk Intermediate Framework Files As you probably know, Android apps utilize code and resources that are found on the Android OS itself. These are known as framework resources and Apktool relies on these to properly decode and build apks. Every Apktool release contains internally the most up to date AOSP framework at the time of the release. This allows you to decode and build most apks without a problem. However, manufacturers add their own framework files in addition to the regular AOSP ones. To use apktool against these manufacturer apks you must first install the manufacturer framework files. Example Lets say you want to decode HtcContacts.apk from an HTC device. If you try you will get an error message. $ apktool d HtcContacts.apk I: Loading resource table... I: Decoding resources... I: Loading resource table from file: 1.apk W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable W: Could not decode attr value, using undecoded value instead: ns=android, name=icon Can't find framework resources for package of id: 2. You must install proper framework files, see project website for more info. We must get HTC framework resources before decoding this apk. We pull com.htc.resources.apk from our device and install it $ apktool if com.htc.resources.apk I: Framework installed to: 2.apk Now we will try this decode again. $ apktool d HtcContacts.apk I: Loading resource table... I: Decoding resources... I: Loading resource table from file: /home/brutall/apktool/framework/1.apk I: Loading resource table from file: /home/brutall/apktool/framework/2.apk I: Copying assets and libs... As you can see. Apktool leveraged both 1.apk and 2.apk framework files in order to properly decode this application. Finding Frameworks For the most part any apk in /system/framework on a device will be a framework file. On some devices they might reside in /data/system-framework and even cleverly hidden in /system/app or /system/priv-app. They are usually named with the naming of "resources", "res" or "framework". Example HTC has a framework called com.htc.resources.apk, LG has one called lge-res.apk After you find a framework file you could pull it via adb pull /path/to/file or use a file manager application. After you have the file locally, pay attention to how Apktool installs it. The number that the framework is named during install corresponds to the pkgId of the application. These values should range from 1 to 9. Any APK that installs itself as 127 is 0x7F which is an internal pkgId. Internal Frameworks Apktool comes with an internal framework like mentioned above. This file is copied to $HOME/apktool/framework/1.apk during use. Warning Apktool has no knowledge of what version of framework resides there. It will assume its up to date, so delete the file during Apktool upgrades Managing framework files Frameworks are stored in $HOME/apktool/framework for Windows and Unix systems. Mac OS X has a slightly different folder location of $HOME/Library/apktool/framework. If these directories are not available it will default to java.io.tmpdir which is usually /tmp. This is a volatile directory so it would make sense to take advantage of the parameter --frame-path to select an alternative folder for framework files. Note Apktool has no control over the frameworks once installed, but you are free to manage these files on your own. Tagging framework files Frameworks are stored in the naming convention of: -.apk. They are identified by pkgId and optionally custom tag. Usually tagging frameworks isn't necessary, but if you work on apps from many different devices and they have incompatible frameworks, you will need some way to easily switch between them. You could tag frameworks by: $ apktool if com.htc.resources.apk -t hero I: Framework installed to: /home/brutall/apktool/framework/2-hero.apk $ apktool if com.htc.resources.apk -t desire I: Framework installed to: /home/brutall/apktool/framework/2-desire.apk Then: $ apktool d HtcContacts.apk -t hero I: Loading resource table... I: Decoding resources... I: Loading resource table from file: /home/brutall/apktool/framework/1.apk I: Loading resource table from file: /home/brutall/apktool/framework/2-hero.apk I: Copying assets and libs... $ apktool d HtcContacts.apk -t desire I: Loading resource table... I: Decoding resources... I: Loading resource table from file: /home/brutall/apktool/framework/1.apk I: Loading resource table from file: /home/brutall/apktool/framework/2-desire.apk I: Copying assets and libs... You don't have to select a tag when building apk - apktool automatically uses the same tag, as when decoding. Smali Debugging Warning SmaliDebugging has been marked as deprecated in 2.0.3, and removed in 2.1. Please check SmaliIdea for a debugger. Apktool makes possible to debug smali code step by step, watch variables, set breakpoints, etc. General information Generally we need several things to run Java debugging session: debugger server (usually Java VM) debugger client (usually IDE like IntelliJ, Eclipse or Netbeans) client must have sources of debugged application server must have binaries compiled with debugging symbols referencing these sources sources must be java files with at least package and class definitions, to properly connect them with debugging symbols In our particular situation we have: server: Monitor (Previously DDMS), part of Android SDK, standard for debugging Android applications - explained here client: any JPDA client - most of decent IDEs have support for this protocol. sources: smali code modified by apktool to satisfy above requirements (".java" extension, class declaration, etc.). Apktool modifies them when decoding apk in debug mode. binaries: when building apk in debug mode, apktool removes original symbols and adds new, which are referencing smali code (line numbers, registers/variables, etc.) Info To successfully run debug sessions, the apk must be both decoded and built in debug mode. Decoding with debug decodes the application differently to allow the debug rebuild option to inject lines allowing the debugger to identify variables and types.-d / --debug General instructions Above information is enough to debug smali code using apktool, but if you aren't familiar with DDMS and Java debugging, then you probably still don't know how to do it. Below are simple instructions for doing it using IntelliJ or Netbeans. Decode apk in debug mode: $ apktool d -d -o out app.apk Build new apk in debug mode: $ apktool b -d out Sign, install and run new apk. Follow sub-instructions below depending on IDE. IntelliJ (Android Studio) instructions In IntelliJ add new Java Module Project selecting the "out" directory as project location and the "smali" subdirectory as content root dir. Run Monitor (Android SDK /tools folder), find your application on a list and click it. Note port information in last column - it should be something like "86xx / 8700". In IntelliJ: Debug -> Edit Configurations. Since this is a new project, you will have to create a Debugger. Create a Remote Debugger, with the settings on "Attach" and setting the Port to 8700 (Or whatever Monitor said). The rest of fields should be ok, click "Ok". Start the debugging session. You will see some info in a log and debugging buttons will show up in top panel. Set breakpoint. You must select line with some instruction, you can't set breakpoint on lines starting with ".", ":" or "#". Trigger some action in application. If you run at breakpoint, then thread should stop and you will be able to debug step by step, watch variables, etc. Netbeans instructions In Netbeans add new Java Project with Existing Sources, select "out" directory as project root and "smali" subdirectory as sources dir. Run DDMS, find your application on a list and click it. Note port information in last column - it should be something like "86xx / 8700". In Netbeans: Debug -> Attach Debugger -> select JPDA and set Port to 8700 (or whatever you saw in previous step). Rest of fields should be ok, click "Ok". Debugging session should start: you will see some info in a log and debugging buttons will show up in top panel. Set breakpoint. You must select line with some instruction, you can't set breakpoint on lines starting with ".", ":" or "#". Trigger some action in application. If you run at breakpoint, then thread should stop and you will be able to debug step by step, watch variables, etc. Limitations/Issues Because IDE doesn't have full sources, it doesn't know about class members and such. Variables watching works because most of data could be read from memory (objects in Java know about their types), but if for example, you watch an object and it has some nulled member, then you won't see, what type this member is. 9Patch Images Docs exist for the mysterious 9patch images here and there. (Read these first). These docs though are meant for developers and lack information for those who work with already compiled 3rd party applications. There you can find information how to create them, but no information about how they actually work. I will try and explain it here. The official docs miss one point that 9patch images come in two forms: source & compiled. source - You know this one. You find it in the source of an application or freely available online. These are images with a black border around them. compiled - The mysterious form found in apk files. There are no borders and the 9patch data is written into a binary chunk called npTc. You can't see or modify it easily, but Android OS can as its quicker to read. There are problems related to the above two points. You can't move 9patch images between both types without a conversion. If you try and unpack 9patch images from an apk and use it in the source of another, you will get errors during build. Also vice versa, you cannot take source 9patch images directly into an apk. 9patch binary chunk isn't recognized by modern image processing tools. So modifying the compiled image will more than likely break the npTc chunk, thus breaking the image on the device. The only solution to this problem is to easily convert between these two types. The encoder (which takes source to compiled) is built into the aapt tool and is automatically used during build. This means we only need to build a decoder which has been in apktool since v1.3.0 and is automatically ran on all 9patch images during decode. So if you want to modify 9patch images, don't do it directly. Use apktool to decode the application (including the 9patch images) and then modify the images. At that point when you build the application back, the source 9patch images will be compiled. Other FAQ What about the -j switch shown from the original YouTube videos? Read Issue 199. In short - it doesn't exist. Is it possible to run apktool on a device? Sadly not. There are some incompatibilities with SnakeYAML, java.nio and aapt Where can I download sources of apktool? From our Github or Bitbucket project. Resulting apk file is much smaller than original! Is there something missing? There are a couple of reasons that might cause this. Apktool builds unsigned apks. This means an entire directory META-INF is missing. New aapt binary. Newer versions of apktool contain a newer aapt which optimizes images differently. These points might have contributed to a smaller than normal apk There is no META-INF dir in resulting apk. Is this ok? Yes. META-INF contains apk signatures. After modifying the apk it is no longer signed. You can use -c / --copy-original to retain these signatures. However, using -c uses the original AndroidManifest.xml file, so changes to it will be lost. What do you call "magic apks"? For some reason there are apks that are built using modified build tools. These apks don't work on a regular AOSP Android build, but usually are accompanied by a modified system that can read these modified apks. Apktool cannot handle these apks, therefore they are "magic". Could I integrate apktool into my own tool? Could I modify apktool sources? Do I have to credit you? Actually the Apache License, which apktool uses, answers all these questions. Yes you can redistribute and/or modify apktool without my permission. However, if you do it would be nice to add our contributors (brut.all, iBotPeaches and JesusFreke) into your credits but it's not required. Where does apktool store its framework files? unix - $HOME/.local/share/apktool mac - $HOME/Library/apktool windows - $HOME/AppData/Local/apktool Options Utility Options that can be executed at any time. -version, --version Outputs current version. (Ex: 1.5.2) -v, --verbose Verbose output. Must be first parameter -q, --quiet Quiet output. Must be first parameter -advance, --advanced Advance usage output Decode These are all the options when decoding an apk. --api The numeric api-level of the smali files to generate (defaults to targetSdkVersion) -b, --no-debug-info Prevents baksmali from writing out debug info (.local, .param, .line, etc). Preferred to use if you are comparing smali from the same APK of different versions. The line numbers and debug will change among versions, which can make DIFF reports a pain. -f, --force Force delete destination directory. Use when trying to decode to a folder that already exists --keep-broken-res - Advanced If there is an error like "Invalid Config Flags Detected. Dropping Resources...". This means that APK has a different structure then Apktool can handle. This might be a newer Android version or a random APK that doesn't match standards. Running this will allow the decode, but then you have to manually fix the folders with -ERR in them. -m, --match-original - Used for analysis Matches files closest as possible to original, but prevents rebuild. -o, --output The name of the folder that apk gets written to -p, --frame-path The folder location where framework files should be stored/read from -r, --no-res This will prevent the decompile of resources. This keeps the resources.arsc intact without any decode. If only editing Java (smali) then this is the recommend for faster decompile & rebuild -s, --no-src This will prevent the disassemble of the dex files. This keeps the apk classes.dex file and simply moves it during build. If your only editing the resources. This is recommended for faster decompile & rebuild -t, --frame-tag Uses framework files tagged via Rebuild These are all the options when building an apk. -a, --aapt Loads aapt from the specified file location, instead of relying on path. Falls back to $PATH loading, if no file found -c, --copy-original - Will still require signature resign post API18 Copies original AndroidManifest.xml and META-INF folder into built apk -d, --debug Adds debuggable="true" to AndroidManifest file. -f, --force-all Overwrites existing files during build, reassembling the resources.arsc file and classes.dex file -o, --output The name and location of the apk that gets written -p, --frame-path The location where framework files are loaded from
Practical Mod Perl

Copyright
Preface
What You Need to Know
Who This Book Is For
How This Book Is Organized
Reference Sections
Filesystem Conventions
Apache and Perl Versions
Typographic Conventions
Command Interpreter Program (Shell) Conventions
Installing Perl Modules
How to Contact Us
Acknowledgments

Part I: mod_perl Administration
Chapter 1. Introducing CGI and mod_perl
Section 1.1. A Brief History of CGI
Section 1.2. The Apache 1.3 Server Model
Section 1.3. The Development of mod_perl 1.0
Section 1.4. Apache 1.3 Request Processing Phases
Section 1.5. References

Chapter 2. Getting Started Fast
Section 2.1. Installing mod_perl 1.0 in Three Steps
Section 2.2. Installing mod_perl on Unix Platforms
Section 2.3. Configuring and Starting the mod_perl Server
Section 2.4. Installing mod_perl for Windows
Section 2.5. Preparing the Scripts Directory
Section 2.6. A Sample Apache::Registry Script
Section 2.7. A Simple mod_perl Content Handler
Section 2.8. Is This All We Need to Know About mod_perl?
Section 2.9. References

Chapter 3. Installing mod_perl
Section 3.1. Configuring the Source
Section 3.2. Building mod_perl (make)
Section 3.3. Testing the Server (make test)
Section 3.4. Installation (make install)
Section 3.5. Installation Scenarios for Standalone mod_perl
Section 3.6. Building mod_perl with Other Components
Section 3.7. Installing mod_perl with the CPAN.pm Interactive Shell
Section 3.8. Installing mod_perl on Multiple Machines
Section 3.9. Installation into a Nonstandard Directory
Section 3.10. How Can I Tell if mod_perl Is Running?
Section 3.11. General Notes
Section 3.12. References

Chapter 4. mod_perl Configuration
Section 4.1. Apache Configuration
Section 4.2. mod_perl Configuration
Section 4.3. The Startup File
Section 4.4. Apache Configuration in Perl
Section 4.5. Validating the Configuration Syntax
Section 4.6. The Scope of mod_perl Configuration Directives
Section 4.7. Apache Restarts Twice
Section 4.8. Enabling Remote Server Configuration Reports
Section 4.9. Tips and Tricks
Section 4.10. Configuration Security Concerns
Section 4.11. General Pitfalls
Section 4.12. References

Chapter 5. Web Server Control, Monitoring, Upgrade, and Maintenance
Section 5.1. Starting the Server in Multi-Process Mode
Section 5.2. Starting the Server in Single-Process Mode
Section 5.3. Using kill to Control Processes
Section 5.4. Using apachectl to Control the Server
Section 5.5. Validating Server Configuration
Section 5.6. Setuid root Startup Scripts
Section 5.7. Preparing for Machine Reboot
Section 5.8. Upgrading a Live Server
Section 5.9. Three-Tier Server Scheme: Development, Staging, and Production
Section 5.10. Web Server Monitoring
Section 5.11. Server Maintenance Chores
Section 5.12. References

Chapter 6. Coding with mod_perl in Mind
Section 6.1. Before You Start to Code
Section 6.2. Exposing Apache::Registry Secrets
Section 6.3. Namespace Issues
Section 6.4. Perl Specifics in the mod_perl Environment
Section 6.5. CHECK and INIT Blocks
Section 6.6. Apache::Registry Specifics
Section 6.7. Transition from mod_cgi Scripts to Apache Handlers
Section 6.8. Loading and Reloading Modules
Section 6.9. Handling the "User Pressed Stop Button" Case
Section 6.10. Handling Server Timeout Cases and Working with $SIG{ALRM}
Section 6.11. Generating Correct HTTP Headers
Section 6.12. Method Handlers: The Browse and See, Browse and View Example
Section 6.13. References


Part II: mod_perl Performance
Chapter 7. Identifying Your Performance Problems
Section 7.1. Looking at the Big Picture
Section 7.2. Asking the Right Questions
Section 7.3. References

Chapter 8. Choosing a Platform for the Best Performance
Section 8.1. Choosing the Right Operating System
Section 8.2. Choosing the Right Hardware
Section 8.3. References

Chapter 9. Essential Tools for Performance Tuning
Section 9.1. Server Benchmarking
Section 9.2. Perl Code Benchmarking
Section 9.3. Process Memory Measurements
Section 9.4. Apache::Status and Measuring Code Memory Usage
Section 9.5. Code Profiling Techniques
Section 9.6. References

Chapter 10. Improving Performance with Shared Memory and Proper Forking
Section 10.1. Sharing Memory
Section 10.2. Forking and Executing Subprocessesfrom mod_perl
Section 10.3. References

Chapter 11. Tuning Performance by Tweaking Apache's Configuration
Section 11.1. Setting the MaxClients Directive
Section 11.2. Setting the MaxRequestsPerChild Directive
Section 11.3. Setting MinSpareServers, MaxSpareServers, and StartServers
Section 11.4. KeepAlive
Section 11.5. PerlSetupEnv
Section 11.6. Reducing the Number of stat( ) Calls Made by Apache
Section 11.7. Symbolic Links Lookup
Section 11.8. Disabling DNS Resolution
Section 11.9. Response Compressing
Section 11.10. References

Chapter 12. Server Setup Strategies
Section 12.1. mod_perl Deployment Overview
Section 12.2. Standalone mod_perl-Enabled Apache Server
Section 12.3. One Plain and One mod_perl-Enabled Apache Server
Section 12.4. One Light Non-Apache and One mod_perl-Enabled Apache Server
Section 12.5. Adding a Proxy Server in httpd Accelerator Mode
Section 12.6. The Squid Server and mod_perl
Section 12.7. Apache's mod_proxy Module
Section 12.8. mod_rewrite Examples
Section 12.9. Getting the Remote Server IP in the Backend Server in the Proxy Setup
Section 12.10. Frontend/Backend Proxying with Virtual Hosts
Section 12.11. HTTP Authentication with Two Servers and a Proxy
Section 12.12. When One Machine Is Not Enough for Your RDBMS DataBase and mod_perl
Section 12.13. Running More than One mod_perl Server on the Same Machine
Section 12.14. SSL Functionality and a mod_perl Server
Section 12.15. Uploading and Downloading Big Files
Section 12.16. References

Chapter 13. TMTOWTDI: Convenience and Habit Versus Performance
Section 13.1. Apache::Registry PerlHandler Versus Custom PerlHandler
Section 13.2. Apache::args Versus Apache::Request::param Versus CGI::param
Section 13.3. Buffered Printing and Better print( ) Techniques
Section 13.4. Interpolation, Concatenation, or List
Section 13.5. Keeping a Small Memory Footprint
Section 13.6. Object Methods Calls Versus Function Calls
Section 13.7. Using the Perl stat( ) Call's Cached Results
Section 13.8. time( ) System Call Versus $r->request_time
Section 13.9. Printing Unmodified Files
Section 13.10. Caching and Pre-Caching
Section 13.11. Caching with Memoize
Section 13.12. Comparing Runtime Performance of Perl and C
Section 13.13. References

Chapter 14. Defensive Measures for Performance Enhancement
Section 14.1. Controlling Your Memory Usage
Section 14.2. Coding for a Smaller Memory Footprint
Section 14.3. Conclusion
Section 14.4. References

Chapter 15. Improving Performance Through Build Options
Section 15.1. Server Size as a Function of Compiled-in Features
Section 15.2. mod_status and ExtendedStatus On
Section 15.3. DYNAMIC_MODULE_LIMIT Apache Build Option
Section 15.4. Perl Build Options
Section 15.5. Architecture-Specific Compile Options
Section 15.6. References

Chapter 16. HTTP Headers for Optimal Performance
Section 16.1. Date-Related Headers
Section 16.2. Content Headers
Section 16.3. Content Negotiation
Section 16.4. HTTP Requests
Section 16.5. Avoiding Dealing with Headers
Section 16.6. References


Part III: Databases and mod_perl
Chapter 17. Databases Overview
Section 17.1. Volatile Databases
Section 17.2. Non-Volatile Databases
Section 17.3. References

Chapter 18. mod_perl Data-Sharing Techniques
Section 18.1. Sharing the Read-Only Data in and Between Processes
Section 18.2. Sharing Data Between Various Handlers
Section 18.3. References

Chapter 19. DBM and mod_perl
Section 19.1. mod_perl and DBM
Section 19.2. Resource Locking
Section 19.3. Flawed Locking Methods
Section 19.4. Locking Wrappers Overview
Section 19.5. Tie::DB_Lock
Section 19.6. Examples
Section 19.7. References

Chapter 20. Relational Databases and mod_perl
Section 20.1. Persistent Database Connections with Apache::DBI
Section 20.2. Improving Performance
Section 20.3. DBI Debug Techniques
Section 20.4. References


Part IV: Debugging and Troubleshooting
Chapter 21. Error Handling and Debugging
Section 21.1. Warnings and Errors Explained
Section 21.2. Debugging Code in Single-Server Mode
Section 21.3. Tracing System Calls
Section 21.4. Tracing mod_perl-Specific Perl Calls
Section 21.5. Debugging Perl Code
Section 21.6. Analyzing Dumped core Files
Section 21.7. Hanging Processes: Detection and Diagnostics
Section 21.8. Useful Debug Modules
Section 21.9. Looking Inside the Server
Section 21.10. References

Chapter 22. Troubleshooting mod_perl
Section 22.1. Configuration and Startup
Section 22.2. Code Parsing and Compilation
Section 22.3. Runtime
Section 22.4. Shutdown and Restart

Chapter 23. Getting Help and Online Resources
Section 23.1. How to Report Problems
Section 23.2. Mailing List Etiquette
Section 23.3. Resources


Part V: mod_perl 2.0
Chapter 24. mod_perl 2.0: Installation and Configuration
Section 24.1. What's New in Apache 2.0
Section 24.2. What's New in Perl 5.6.0-5.8.0
Section 24.3. What's New in mod_perl 2.0
Section 24.4. Installing mod_perl 2.0
Section 24.5. Configuring mod_perl 2.0
Section 24.6. Resources

Chapter 25. Programming for mod_perl 2.0
Section 25.1. Migrating to and Programming with mod_perl 2.0
Section 25.2. New Apache Phases and Corresponding Perl*Handlers
Section 25.3. I/O Filtering


Part VI: Appendixes
Appendix A. mod_perl Recipes
Section A.1. Emulating the Authentication Mechanism
Section A.2. Reusing Data from POST Requests
Section A.3. Redirecting POST Requests
Section A.4. Redirecting While Maintaining Environment Variables
Section A.5. Handling Cookies
Section A.6. Sending Multiple Cookies with the mod_perl API
Section A.7. Sending Cookies in REDIRECT Responses
Section A.8. CGI::params in the mod_perlish Way
Section A.9. Sending Email from mod_perl
Section A.10. mod_rewrite in Perl
Section A.11. Setting PerlHandler Based on MIME Type
Section A.12. Singleton Database Handles
Section A.13. Terminating a Child Process on Request Completion
Section A.14. References

Appendix B. Apache Perl Modules
Section B.1. Development-Stage Modules
Section B.2. Modules to Aid Debugging
Section B.3. Control and Monitoring Modules
Section B.4. Server Configuration Modules
Section B.5. Authentication-Phase Modules
Section B.6. Authorization-Phase Modules
Section B.7. Access-Phase Modules
Section B.8. Type Handlers
Section B.9. Trans Handlers
Section B.10. Fixup Handlers
Section B.11. Generic Content-Generation Modules
Section B.12. Application-Specific Content-Generation Modules
Section B.13. Database Modules
Section B.14. Toolkits and Frameworks for Content-Generation and Other Phases
Section B.15. Output Filters and Layering Modules
Section B.16. Logging-Phase Handlers
Section B.17. Core Apache Modules
Section B.18. Other Miscellaneous Modules

Appendix C. ISPs Providing mod_perl Services
Section C.1. Users Sharing a Single Web Server
Section C.2. Users Sharing a Single Machine
Section C.3. Giving Each User a Separate Machine (Colocation)
Section C.4. Giving Each User a Virtual Machine

Appendix D. The Template Toolkit
Section D.1. Fetching and Installing the Template Toolkit
Section D.2. Overview
Section D.3. Typical Uses
Section D.4. Template Toolkit Language
Section D.5. Processing Templates
Section D.6. Apache/mod_perl Handler
Section D.7. Apache::Template Module
Section D.8. Hangman Application
Section D.9. References

Appendix E. The AxKit XML Application Server
Section E.1. Installing and Configuring AxKit
Section E.2. Your First AxKit Page
Section E.3. Dynamic Content
Section E.4. More XPathScript Details
Section E.5. XSLT
Section E.6. Putting Everything Together
Section E.7. More Reasons to Use AxKit

Appendix F. HTTP Status Codes
Section F.1. HTTP/1.0 Status Codes
Section F.2. HTTP/1.1 Status Codes
Section F.3. References


Colophon
Index
SakEmail components Copyright ?1997 - 2003 Sergio A. Kessler web: http://groups.yahoo.com/group/sakemail/To subscribe to the mailing list of sakemail, just go tohttp://groups.yahoo.com/group/sakemail/History:0.9 - First released version0.9.1b -Fixed when a mail server reply on the connection with more than one line0.9.2b - I forget to return a value in functions retrieveHeader/Message =) and fixed it. Some minor bugs that I don‘t remember fixed.- Added MIME-compliant base64 support (not for use by now). Added examples.0.9.2.1b- Fixed a bug when send a mail and the first line disappear (thanks to Arun)- Now, you could do MySMTP.MsgTo := ‘a@doma.com; b@domb.com;c@domc.com‘; the spaces before/after semicolon doesn‘t matter (I hope ;)).0.9.3b- Many changes, I added a SakMsg component that make send binary attachments a snap. But have one problem, if you send as attach a file > 20 Kb, it doesn‘t work (I don‘t know why, maybe a problem of sockets). Developed with a version 2.0b of WSockets and D3.0.9.3.1b- Changed the POP.login to a function that return the number of new msgs.- Added the event OnRetrieveProgress on the SakPOP, and fixed the example, sorry =)- Minor changes to the code.1.0- Developed with WSockets 1.2 POP.Login now return a boolean depending id the user is authorized, and POP.Init return the number of new msgs.1.01- Fixed a bug with a bounced mail.1.02- Minor bugs fixed (some variants of boundary)14/10/971.1.0- Warning: WSockets1.2 have some bugs that result in bad attachments. So I decided to use the sockets of Delphi 3 founded in D3 c/s D3.01 pro and D3.01 c/s. Now all seems to work fine and much more smooth. And of course the interface of SakEmail hasn‘t changed.26/10/971.2.0- Added the Reply-To field to TSakMsg comp. Now you must use ‘,‘ when you want to send the msg. to multiple recipients, i.e.: ‘a@doma.com, b@domb.com,c@domc.com‘ This change is done for better compatibility with other emails clients.- Better formatting of the field Date of TSakMsg. Some changes to the code.17/11/971.2.1- Now, all searches are made in case-insensitive, it could prevent some unexpected responses (no one reported, but...). Some changes to the code (again).20/11/971.2.2- Some bugs fixed. (Thanks to Serge Wagener from .lu)24/11/971.2.3- Added the field ‘MIME-Version: 1.0‘. It seems that is necessary :)25/11/971.3.0- Added compatibility with SCO and VAX servers. Fixed a minor bug with the boundary.- Change the generator of the message id.- Added the field MessageId and InReplyTo to the TSakMsg component.- Added the field In-Reply-To that is added to the message generated when it is <> ‘‘.30/11/971.3.1- Almost rewrote the parsing code. Now is more easy for you if you want hack/modify the code.- Better treatment of emails with html inside.15/12/971.4- Added support for UUCoded attachments.- Added a small delay when sending the email, seems that some servers can‘t deglut the info too fast, causing problems with sockets buffers and leading to crash the client machine, I don‘t know if is a Borland bug or Microsoft bug. (thanks to Don Higgins).19/12/971.4.1- Fixed a bug that send double ‘<‘ and ‘>‘ (ie. <>) when the full user name is used. Check the new SMTP demo. Thanks to Serge Wagener for locate this bug, track it down and send me the fix.2/2/981.5.0- Added the Canceled property to TSakPOP and to TSakSMTP. Due to this addition now RetrieveAllMessages is a function that return the number of msgs. retrieved and SendMessage is a boolean function (maybe someone has pressed the cancel btn).- Fixed a bug when the subject field is too large.9/2/981.5.1- Fixed a bug with a message within a message (recursive msgs).18/2/981.5.2- Fixed a bug what happens when after the field ‘To:‘ appear a blank line(Thanks to Osvaldo Fillia). Fixed a bug when sending email to more than two address (the separator is still ‘,‘).9/3/981.6.0- Sometimes the filenames of an attachment contain invalid chars making very dificult to open a TSaveDialog (you have noted this ?), now SakEmail deletes the invalid chars.- Applied a patch from Matjaz Bravc, that resolve the problem of localized dates, letting you choose (in design time) if you want localized dates (NOT recommended) or standards dates (english) via the LocalizedDates boolean property in the TSakSMTP comp. Thanks also to Serge Dosyukov for sending me a fix.- Also I applied another patch of Gregor Duchalski that cure a bug with PChar when this unit is used under NT. - It seems that some machines need more delay when sendig a msg (see previous posting 19/12/97), thanks to Matjaz Bravc.- I discover a bug in the transparency code, it is fixed now. Did you see the benefits of Open Source Software ? :)26/3/981.6.1- Added a FUNCFileName private variable to manage the complete path of the attached file. I receive problems reports with this, it work now ?.- Reduced the line sleep to 30 (tell me if this value doesn‘t work for you).27/4/981.7.0- Fixed a memory leak, thanks to Don Higgins.- Moved the string esErrorInFormatOfMsg to a property of SakPOP.- Because some people need to use IP addresses instead of Host names, I‘ve added a new property IPAddress to SakPOP and SakSMTP. If both are filled, then the Host name will be used, thanks to Roger F. Reghin for reporting this. The side effect for this is that YOUR app must check if the host is a host name or a IP address, in my app I remove the periods and try to convert the result to a float (long integers don‘t work, but float accept chars ‘e‘) if it doesn‘t work I assume that is a host name (someone has a better and simple idea ?).- Added the property FileStream to the class TAtachedFile and the procedure SaveToStream, this was done by Brian Sheperd- The address separator (in the TO: field) is ‘,‘ and ‘;‘ now (before it was ‘,‘ only).1.7.1- Roger F. Reghin has sended me a pair of nice patches that resolve in a good behavior when the destination address is something like "Roger Reghin" and some servers says that they couldn‘t relay that mail, etc. Also Roger has made the IPAddress property obsolete (do not use it, use Host instead), SakEmail will resolve the host properly no matter if it is a host name or a IP address. So in the next version I will remove the IPAddress property. Thank you, Roger.1.8.0- Well, it seems that I made a mistake, I investigated the previous behavior and it is a fault of the SMTP (RFC 821), so I fixed it.- The IPAddress property has been removed, use Host. Goeran Strehl (asem) has sended me a patch that fix a memory leak and one problem with the object inspector and the Text property of a SakMsg. Dmitry Bondarenko say that some servers do not send the msg size after the RETR command, so he fix that issuing a LIST n command first (work nicely).- Added the property CC (Carbon Copy) to the SakMsg object.1.8.1- Added the property ReturnPath to the SakMsg comp. Minor changes to the scanning code for the filename of attachments.1.8.2- Fixed a bug with the filename of attachments (thanks to Taufer Pavel Ing.).- Added the function IsIPAddress from hou yg (the actual code don‘t work if the server is 265.net :) Fixed a minor bug with html pages like attachments. Some fucking email server return a bounded message declaring the boundary like ‘boundary = ‘ and not ‘boundary=‘ wich is clear in the RFC, fixed.1.8.3- A obscure bug was found by HuangYeJun from china, in the RetrieveHeaders function if the retrieved text was larger than 1024 bytes and the crlf.crlf fall in the middle of two chunks, the function is blocked. I don‘t use this function, btw.1.8.3.1- Just cleaned up a bit the FindUUAtachs function. Not bug or enhancements release. Serge Wagener put me to work >:|1.8.4- Dmitry Bondarenko (again) has found a bug in wich I do not respect the RFC, wich say that replys from the SMTP server could be multi-line, and the previous version just manage as far as two lines. He also send me a nice patch, so the bug is fixed.- Craig Manley added a ExtraHeaders property, please, use with care, it‘s just not valid to put inside it whatever thing.- The CC header was not being added to the headers that were being sent, so Craig fixed it.- Warning: I‘ve put try/except in the TSakPOP.Connect and TSMTP.Connect function around the line FSocket.Open, so you will need to write something like: myPOP.Connect; if POPError then ... in your code, the old way was: try myPOP.Connect; except ..... end; If you are strongly opossed to this change, drop me a line and tell me why (I‘m in doubts).1.8.5- Greg Nixon added the priority property. The default priority for each msg created will be prNormal, so you don‘t need to change your code any bit.1.8.6- Ulf Sturegren has added D4 compatibility, not many changes to the source (one letter), but he found the error.- Hou yg has sent to me a revisited IsIPAddress function, so I put the newer function in, infortunely my reply to him doesn‘t want to go.1.8.7- Ok, I discovered a weird bug, some old emailers (navigator 2) does not format the message in multipart mode if people send an attach, without writing any text and with no MIME settings. Fixed. This could be serious, I recommend upgrading.1.8.8- A small fix with the CC field. Some stupid mail servers put tabs in some fields (CC:, TO:) when they want to make a new line, the correct is to put at least a space in the beginning of the line, added a little code to "fix" that.1.8.9- Some ‘moderns‘ pop3 servers doesn‘t support the LAST command, so I‘ve added a little code to cope with this and added a boolean property ServerSupportLastCmd. See TSakPOP.Init for more details. Reported by Jan Najvarek.1.9.0- Kaufman Alex has added two properties to the SakMsg object, the ContentType and the Headers property, that should be self explaining (I modified a little the code he sended me, btw).1.9.1- I rewrote and greatly simplified the code that deal with the multiple address in the TO: field and remove some possible bugs in it.1.9.2- Alex discovered and fix a bug when a file attached is not enclosed between quotes, resulting in the filename without the first and last character.1.9.3- Better detection of the boundary in multipart messages. Fixed a bug when the attached file is empty.1.9.4- Chris G黱ther send me *lots* of memory leaks fixes, very good job, Chris. - Some weird PGP messages are now processed well.- Yang Qiandong from china fixed a compiler hint and a warning.- Modified TSakSMTP.FReceiveTextFromSocket as suggested by Greg Nixon.- Dmitry Bondarenko send me a patch that fixes some issues with the LAST command (that some servers don‘t implement) and other patch that fixes a problem when servers add spare words in the tail of the answer.- Some minor changes suggested by Matthew Vincent.- Support for _big_ attachments files (me).- Make the code more modular and simple (still is not very modular).1.10.0- Move some stuff to a sak_util unit.- Support for quoted-printable msgs, thanks to Chris G黱ther.- Fix the BCC field.- New property sakMsg.ContentTransferEncoding.2.0.0- Major reestructure of the files and the source code.- Simplifyied sakPOP3.pas a _lot_- Support encapsulated messages (message/rfc822).- Nested multipart messages are processed fine.- Attachs with quoted-printable are processed fine.- Many bugs fixes.2.0.1- A fiasco, sorry.2.0.2- Fixed a bug in the sak_CleanUpAddress.- Do the rigth job if the ContentType is ‘plain/text‘ and the encoding is base64.- Redone sak_ExtractAddress and sak_ExtractAlias.- New ‘Sender‘ property in SakMsg (normally not used, so do not use it, unless you know what you are doing) ‘Thanks‘ to Alex Kaufman for this.2.0.3- A *severe* bug with multiple addresses was fixed.2.0.4- Fixed bogus Message-number (Message-id is the correct) Thanks to Peter Honan- Added SizeInBytes property to the SakMsg component. (petition of Alex Kaufman)- Fixed a minor bug in TSakPOP.RetrieveHeaders. Fix from Alex.- Added RetrieveMessageOnlyHeaders and - RetrieveAllMessagesOnlyHeaders.2.0.5- Fix when the mail server reply is like (two cr).- Fix function IsIpAddress.- Both fixes by Alessandro Rossi.2.0.6- Fix a bug in the sak_Base64Decode function when the data to decode is null (I found it in the hard way).- Andy Charalambous make it sure you can send more than one email without disconnecting and connecting again.- And Chris ‘Memory Hunter‘ G黱ther killed some memory leaks (again).2.2.0- the f* sleep line that was bothering us for years is gone, gone, gone. Thanks to Syed Ahmed.- a getUIDL method of SakPOP. Thanks to Alex Kaufman.- a UIDL property on SakMsg. (me)- a SakPOP.GetUIDLsOnRetrieve boolean property (default false) (me)- change some ‘Exception.Create()‘ to ‘raise Exception.Create()‘ Thanks to Anton Saburov.- change SakPOP.Init from function to procedure (me)- new SakPOP.NewMsgsCount property (me)- changed SakPOP.Password to SakPOP.UserPassword (me)- changed SakPOP.ErrorInFormatOfMsg to SakPOP.StrErrorInFormatOfMsg- OnLookup event on SakPOP and SakSMTP. Thanks to Syed Ahmed.- OnConnecting event on SakPOP and SakSMTP (me).- OnReceiveTextFromSocket event on SakPOP and SakSMTP (me). (mostly for debug)- OnSendTextToSocket event on SakPOP and SakSMTP (me). (mostly for debug)- Headers are retrieved without the mail body (ugly bug, fix from Alex Kaufman)2.4.0- I‘ve revamped TSakMsg, many funcionality from SakPOP was moved to SakMsg, where it belongs.- Now SakMsg has a RawMail property wich you may find useful, now you can do: SakMsg1.RawMail.LoadFromFile(‘(uidl).mail‘); SakMsg1.ParseMsg; or SakMsg1.RawMail.LoadFromStream( myStream); SakMsg1.ParseMsg; or SakMsg1.RawMail.SaveToFile( ‘(uidl).mail‘); etc, etc...- Added a property TSakMsg.ClearRawMailAfterParse for memory saving.- the return of the f* sleep line (it causes freezes on winsock 1.1 systems like win95, win98 has winsock 2 so there is no problem if you remove the line)- lost of the DecodeProgess events :( (sorry, I don‘t know how to fit this events on the new SakMsg)2.6.0- the sleep() line is dead, it will never come back. Sending an email is a pleasure now.- SakMsg has a TextEncoding (8Bit, Base64) property, I think this will be useful to people with others charset than iso-8859-1- the base64 routines have been rewritten, they are more OO and faster (they are now in SakMIME.pas).- cosmetic changes all over the place.2.6.1- simplifyed ParseMsg2 a lot, it work better now.- speed up the search for uucoded attachs (the previous search was very dumb)- fixed bug Msg.SizeInBytes always 0- added a couple of Application.ProcessMessages to make the app more responsive.2.6.2- moved some functions from sak_utils to SakMIME.- make const parameters all over the place.- fix the bug that introduces a final crlf in quoted-printable attachs.- fix a division by zero if attached file is 0 bytes long, fixed by Peter Kollanyi.2.6.3- fix a rare bug when the header of a email (more probably a encapsulated one) has first line/s in blank. Easy and innocuous bug.2.6.4- fix the bug that insert the attachs of type text/* on the body of the email.- change the Smtp.SendMessage for Smtp.SendTheMessage to avoid a BCBuilder problem. Both problems reported by Andreas Franzen. SendMessage is still there, but it‘s now deprecated, I will remove it in the future.2.6.5- moved the ParseMsg activation from SakPOP to SakMsg (where it belong), this means that after setting the RawMail property of SakMsg, this does a ParseMsg automatically. before: SakMsg1.RawMail := ... SakMsg1.ParseMsg; now: SakMsg1.RawMail := ... hope I‘m not breaking too much code out there ... :)- some changes in the way attachments are processed (now the html part is separated correctly and images within the html are recognized)- RetrieveMessage() and RetrieveMessageOnlyHeaders() now take an additional parameter, a TSakMsg var, so people can change some parameters before parsing, see the source in SakPOP3.pas (the old way is still supported, but they will be removed in the future)- bug fixes that I do not remember.3.0.0- moved code around.- removed deprecated functions (I told you about this)- new SakAttFile unit.- Base64Encode( AttFile), Base64Decode( AttFile), UUDecode( AttFile) has been moved to the TAtachedFile object, so you can do AttFile.Base64Encode, AttFile.Base64Decode, etc- SakSMTP have lost EncodeStart, EncodeProgess and EncodeEnd events as a consequence of the previous change.- SakPOP.Canceled and SakSMTP.Canceled properties have been made read-only and SakPOP.Cancel and SakSMTP.Cancel procedures (or methods) have been added.- add a SakMsg.FillRawMail method that will fill the RawMail property with a rfc822 message based on the properties of SakMsg.- changed SakSMTP.Quit & SakPOP.Quit to Disconnect- deleted TAttachedFile.FileStream (redundant), use BodyBin- removed the function sak_getTempFileName (as it should no be trusted) use function sak_GetTempPath- the new SakIMAP component !, this make a pleasure to work with incoming emails (as you can have folders, etc). Note: the IMAP component has only been tested with the Uni. of Washington server, but it should work with any *STANDARD COMPLIANT* server. Anyways, the code of this component is very simple, so if you have problems, a look in the source code can enligthen you.3.0.1- fixed a brown paper type of bug.3.0.2- support the case where attachs do not come from files (Lars Karlslund)- minor bugfix in UUDecode function (Lars Karlslund)- if the SakMsg.Username is empty, do a VRFY command at the smtp server to try to get the full user name (sergio)- function TSakIMAP.GetFolderList (Peter Nagel)- function TSakIMAP.GetHierarchyDelim (Peter Nagel)- frustrated intent (ie. commented out) to remove memory leaks in POP, SMTP & IMAP destroy functions (Ronald Moesbergen)3.0.3- actually create (and free) the FolderList in sakIMAP (Neculau Andrei)- try to send the FQDM to the HELO command in SMTP (sergio)- commented out the VRFY command in SakSMTP, and cut the from address in the From field (in SakMsg), so if the username is empty, the SMTP server rewrite the from address in a complete way, with username & full address (sergio)- fix a minor bug in TBase64DecodingStream.Write function (Lars Karlslund)3.4.0- many, many improvements to the IMAP component by Peter Honan (I applied the patch with minor modifications, mainly to respect delphi coding standard, taking out the overloading, the selectFolder function was overcomplicated, etc)- FAQ updated (me)3.4.1- minimize the chance for two temporal messages stored on disk to collide (can be hit in previous versions if you run multiple instances of retrieveMessage at the same time)- FAQ updated.3.4.2- a new sak_CleanUpAddresses() implementation, by Knut Baardsen- better handling for temporal messages, suggested by Andrew- many improvements (including ACL -Access Control List) to the IMAP component by James Chaplin3.4.3- reverted to the old sak_CleanUpAddresses() implementation Knut‘s one is almost rigth, but don‘t let us use addresses without domains- add Headers.Clear before filling headers, by "Antonio Carlos Ribeiro Faria" 3.5.0- add TSakMsg.LoadFromTextFile from Oak Chantosa- big jumbo mambo patch from James Chaplin first patch: 1) Operation timeout - OperationTimeout timeout for non-responding receive operations. 2) Forced abend - ForceAbend method that will disconnect and reset state. 3) Optional folder lists - AvFolderList and AvSUBFolderList provide alternatives to FolderList and SUBFolderList that ensure the lists do not contain inacessible folders ( flagged by the server ). 4) Folder name fix - Provided a function to "fix" folder names before submission. Currently it fixes names containing spaces. second patch: 1) Capability - Ask for server capabilities/extensions. 2) Noop - Basic noop command - updates message counts as well - preferred alternative to status. 3) Status - Explicit status command - generally useful for status of a non-selected mailbox. 4) Fetch - Retrieve message data. 5) FetchBody - Retrieve the body of the message. 6) ExamineFolder - A read-only select command. 7) CloseSelectedFolder - Close the currently selected folder. 8) Idle - RFC2177 extension - not implemented on very many servers. 9) Search - Search based on RFC2066 criteria. 10) UIDSearch - Search based on RFC2066 criteria - results are in UID form. 11) UIDStoreFlags - Store message flags based on UID. 12) UIDFetch - Fetch message data by UID. 13) UIDCopyMessageToFolder - Copy a message by UID. 14) Authenticate - Basic framework. Only plain authentication extension implemented. 15) CloseOnError - A new property that allows the user to turn off the default behaviour of disconnecting from the server when an IMAP error is received 16) Namespace - RFC2342 Namespace query command. 17) ListFullHierarchy - Property which allows a switch between "*" ( default ) or "%" as the wilcard for default folder/list methods. 18) List - Explicit list command in case it is needed. third patch: 1) fix problem with imapd 2001a, reported by Holger Mauermann. 2) remove all warnings.3.5.1- revert change to the base64 encoding routine.3.5.2- changes from James Chaplin: 1) TSakIMAP will now properly process non-numeric UIDs for messages ( there was a sak_StrWord2Int transform being used before - which always produced a 0 value for non-numeric UIDs ). 2) TSakIMAP.RetrieveMessageExt ( private method ) was modified to provide a retrieval by either MsgID or UID. 3) TSakIMAP.RetrieveMessageByUID was modified to use the slightly more efficient TSakIMAP.RetrieveMessageExt(UID) method specified in 2) above. I also made an update to the SakMIME.pas unit. The changes that were implemented are: 1) sak_Base64Encode - a basic Base64 encoder. String input and string output with the option for CRLF splitting. 2) sak_Base64Decode - a basic Base64 decoder. String input and string output with a control for CRLF interpretation. 3) sak_Base64Verify - a very basic Base64 string verifier.3.5.3- robustify and code cleanups by Paul Vernon.3.5.4- access violation fix by Paul Vernon.3.5.5- go back to good old trusty 3.5.23.5.6- this time, all the cleanup & fixes from Paul Vernon seems to work well.3.6.0- Paul Vernon latest minor fixes- added basic SMTP authentication, by Delfi and Antonio Carlos Ribeiro Faria3.6.1- fix a mayor bug when sending to many addresses (by sergio)3.7.0- add full support for html mails, by Paul Vernon. (The TAttachedFile now has an extra boolean property called embedded. This property lets you use the syntax in your HTML mails)- fix a weird typo for BCC fields- add Content-ID, by alejandro Castro- fix "_" characters in subject, regression fix.- cleanups all around, by Paul Vernon.- SMTP example updated to cope with html emails.**warning** from this version, the html part of mails will not be stored as attachments by default, if you want this behavior, you just do something like: aSakMsg := TSakMsg.Create( self); aSakMsg.HTMLAsAttachment := true; ...3.7.1- fix TSakMsg.PopulateList (Jalin)3.7.2 (codenamed "melissa")- fixed a bug when the Populatelist procedure got re-written in sakMsg. It wasn‘t populating the SendTo field if there was only one e-mail address... (Paul Vernon)3.7.3 - Congratulations to Sergio on the addition to his family. This release was made by Paul Vernon who has temporarily taken over the release functions for the SakMail components whilst Sergio spends time AFK!- The 3.7.2 bug fix added blank entries to the address lists. The PopulateList procedure has been re-written again to hopefully cope with any type of e-mail address formatting.- The SMTP example noted in 3.7.0 actually shipped with this release!3.7.4- Bugfix for detecting UUEncoded mails correctly. Previous versions processed MIME mails with the value ‘begin xyz‘ if it appeared at the beginning of a line as a UUEncoded mail when they should not have.- POP and SMTP connect procedures are now functions. Existing code is unaffected. However, you can now use the following code if (sakPOP.Connect) then begin end;- POP gracefully quits if it receives an error now by calling Disconnect correctly.3.7.5- Further code to improve identification of UUEncoded mails. Essentially looking for the end as well as the beginning to ensure that it is correct.- Code optimisation of certain UUEncoded mail id functions.- Fix to ensure that the body of a mail that is UUEncoded is not lost.- MIME-Version string introduced into TsakMsg component to help with UUEncoded mail identification.- SizeInBytes property altered to read private variable using a function. If the private variable is 0, the function reads the length of the FRawMail.Text property.- Fix to make sure that the filename is not overwritten by a blank value when parsing mail-headers.3.7.6- Fixed list index out of bounds error.- Added POP3 RSET call TSakPOP.Reset.3.7.7- Altered SizeInBytes and Octets values to return server-side size when d/l headers only and use actual size once the entire message is downloaded.- Fixed a bug in GetBasicHeaders where To and CC fields could be mishandled if the mail headers were formed in a particular way.4.0.0 beta- All methods are now wrapped in classes. sak_util is now included for backwards compatibility only.- Several changes to make sakMail thread safe including the introduction of Mutexes which are cross process safe. Critical sections were an option however, although mutexes are a little slower, they are much more effective when you aren‘t sure how the code is going to be deployed...- Made several changes to the way connections are tracked, now making better use of the underlying Delphi components own properties and functions.- Several bug fixes included from solutions posted on mailing lists. Including change to datetime function to respect local time separator. There are more including one that Adem re-raised.- Removed almost all pointers as per Adems suggestion. Makes for neater code.- Hopefully backwards compatibility is kept. This is one of the objectives of the excersice although, internally, the components no longer use any of the non-object based methods. Also some of the non-object based methods actually have been re-written to create an object use the instance of the original method and then destroy the object again. This introduces a minor overhead however, because the objects are discreet, the trade is for much better memory usage and greater thread safety.- Introduced an include file to define compiler directives. Currently there are two directives. One defines whether to use the VCL or not, the other defines whether or not to use the FastStrings components. - With the intoduction of the Include file, this allows the development of code that is optional for users. One of these such changed is the use of the FastStrings base64 decoder. If you install the FastStrings components and turn on the compiler directive, you should have no functional changes however, the base64 decoder routines should have a much higher performance rating. Tests clock in at over 2000% faster attachment decoding on a P4 1.8GHz machine. (1.2Mb file 1686mS native sak Base64 Decoder, 79mS using FastStrings!)- This version is being released as a beta as the changes are pretty drastic. If the code is deemed to be stable and backwards compatible then it will be re-released as v4.0.1 with no changes.4.0.1 beta- Fixed an issue where Range Checking highlighted that the Attachment b64 decode routine raise a Range Error if the line that was to be decoded was empty. i.e. ‘‘.- Introduced a compiler directive to turn off range checking in the sakMIME procedure TBase64DecodingStream.Write to make sure that it runs correctly as Range Checking causes issues in this function.4.0.2 beta- Changed MailDateToDateTime function to the one provided by DengZhaoHui with a few modifications as even though it has better date processing than the original it caused EConvertErrors with some non-rfc dates.- Added the compiler directive to allow the inclusion of MD5 components from the DCPCrypt suite of encryption components. This allows the components to do APOP and SMTP AUTH functions as specified in RFCs 2095, 2104, 2449 and 2554. {UseDCP} ***** NOTE: These functions are experimental as although they are RFC compliant, they have not been tested against a secure mail server yet... *****- Using EurekaLog during load testing of the POP mail component, found and fixed several AV‘s in sakMSG, sakMIME and sakPOP. Mainly simple mistakes that required re-ordering of code or more checks before trying to manipulate data.- Altered the sockets code to be more stable with some servers. The previous implementation was totally incompatible with SendMail NT v3.0.2.- Fix added to compensate for incorrect operation of Connected property in some versions of Delphi.- Altered GetMultiLineFieldBody as per Adems suggestion. Also took some of Adems code and added it to GetFieldValueFromLine as the escape characters can appear in single line headers as well as multi-line ones.- TClientSocket is deprecated in Delphi 7. This may be the next large change in the sakEmail components. - Updated distribution to include more RFC‘s regarding the message format, POP and IMAP and hashing functions for CRAM mechanisms.- Fixed the handling of redirected mails as created by Eudora.- Force PopulateList to clear the list before populating it again.- Created a Delphi 6 package file.4.0.3 - Fixed AUTHSMTP buffer initialisation error. (Dmitry G. Kozhinov and Gabi Slonto)- Improved identification of servers that do not support the UIDL command. A small overhead is intorduced on servers that do support the command and have several mails to download but the feature allows better interaction with those servers that do not support UIDL.- Priority is now reported correctly when an e-mail is being decoded rather than only being used when sending an e-mail.4.0.4- Fixed an issue with a malformed header in a mail sent from MS Word through an Exchange server- Added a couple of try...finally blocks to the sakIMAP component.- Altered the sakIMAP components connected function to mirror the more accurate sakPOP method.- Consolidated all compiler directives into sakDef.inc- Added versioning compiler directives to allow the compilation of sakemail under Delphi 4.- General tidying of code. 4.0.5- Created a Delphi 7 package- Added properties to the IMAP component to allow read access to the LocalAddr and LocalHost socket properties.- Bugfix to sakMsg PopulateList function where a comma separated list did not contain any spaces- Access violation in sakPOP component due to incorrect use of free,freeandnil and compiler directives4.0.6- Added several features to the IMAP components.- Tidied up SMTP authentication routines (Improved use of MD5 for authentication using DCP components)- Included capability to send messages without an SMTP server (using Indy DNS components for MX lookups)- Bugfix in message parsing to stop a recursion loop due to a malformed mail.4.0.7- Memory leaks found by Amos and Paul regarding the sakMsg and sakPOP units respectively.- Bug fixes to attachment save code including stripping out invalid .. sequences from filenames- Improved the GetConnectedState method to check against the RemoteHost value on the Socket.- Updated POP example to be more responsive when downloading mail. Fixed a memory leak.Don‘t forget to subscribe to the mailing list (see the web pages at http://groups.yahoo.com/group/sakemail/)

16,466

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧